From 66aa331b0b50290a5517d0305bb7725abca3dad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sz=C5=91ke=20Attila=20=28Shiwaforce=2Ecom=20Zrt=2E=29?= Date: Mon, 19 Feb 2024 22:58:35 +0100 Subject: [PATCH] ci: basic CI present, lints missing yet --- .github/workflows/conventional-commits.yml | 21 ++++++++ .github/workflows/release.yml | 59 ++++++++++++++++++++++ .github/workflows/tauri.yml | 51 +++++++++++++++++++ cog.toml | 2 +- 4 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/conventional-commits.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/tauri.yml diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventional-commits.yml new file mode 100644 index 0000000..cb6b9f1 --- /dev/null +++ b/.github/workflows/conventional-commits.yml @@ -0,0 +1,21 @@ +name: Conventional commits + +on: + push: + branches: ["main"] + pull_request: + branches: ["**"] + types: [opened, synchronize] + +jobs: + check: + runs-on: ubuntu-latest + name: Check conventional commit compliance + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Check commits + uses: cocogitto/cocogitto-action@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ac5962f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +name: Release + +on: + push: + branches: ["main"] + workflow_dispatch: + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Wait on commit checks + uses: lewagon/wait-on-check-action@master + with: + ref: ${{ github.sha }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + check-name: "Check conventional commit compliance" + + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: | + git config user.name github-actions + git config user.email github-actions@github.com + git config --global user.email github-actions@github.com + git config --global user.name github-actions + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Install cargo-edit + uses: baptiste0928/cargo-install@v2 + with: + crate: cargo-edit + + - name: Set up environment with Volta + uses: volta-cli/action@v4 + + - name: Bump + id: release + uses: cocogitto/cocogitto-action@main + with: + check-latest-tag-only: true + release: true + git-user: "github-actions" + git-user-email: "github-actions@github.com" + + - name: Generate Changelog + run: cog changelog --at ${{ steps.release.outputs.version }} -t full_hash > GITHUB_CHANGELOG.md + + - name: Upload github release + uses: softprops/action-gh-release@v1 + with: + body_path: GITHUB_CHANGELOG.md + tag_name: ${{ steps.release.outputs.version }} diff --git a/.github/workflows/tauri.yml b/.github/workflows/tauri.yml new file mode 100644 index 0000000..2f6055a --- /dev/null +++ b/.github/workflows/tauri.yml @@ -0,0 +1,51 @@ +name: Tauri + +on: + push: + branches: ["main"] + pull_request: + branches: ["**"] + types: [opened, synchronize] + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + SQLX_OFFLINE: true + +jobs: + check: + name: Check + permissions: + contents: write + strategy: + fail-fast: true + matrix: + platform: [macos-latest, ubuntu-22.04, windows-latest] + + runs-on: ${{ matrix.platform }} + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Set up environment with Volta + uses: volta-cli/action@v4 + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Install Ubuntu dependencies + if: matrix.platform == 'ubuntu-20.04' + run: | + sudo apt-get update + sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev + + - name: Setup rust cache + uses: Swatinem/rust-cache@v2.2.0 + with: + shared-key: whooosh + + - name: Getting dependencies + run: yarn install --immutable + + - name: Run build + run: tauri-apps/tauri-action@v0 diff --git a/cog.toml b/cog.toml index 05faf64..371f06a 100644 --- a/cog.toml +++ b/cog.toml @@ -1,6 +1,6 @@ ignore_merge_commits = true branch_whitelist = ["main"] -pre_bump_hooks = ["yarn", "yarn version {{version}}"] +pre_bump_hooks = ["yarn install --immutable", "yarn version {{version}}"] post_bump_hooks = ["git push", "git push origin --tags"] [changelog]