feat: Switch to official tauri-action #86
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: App Builder | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v*' | |
| branches: | |
| - master | |
| - main | |
| - release | |
| - develop | |
| - beta | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| RUST_TOOLCHAIN_VERSION: 1.93.0 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-22.04, windows-latest] | |
| # todo we might want to bump this | |
| node-version: [18.x] | |
| include: | |
| # - platform: 'macos-latest' | |
| # args: '--target aarch64-apple-darwin' | |
| # - platform: 'macos-latest' | |
| # args: '--target x86_64-apple-darwin' | |
| - platform: 'ubuntu-22.04' | |
| args: '' | |
| - platform: 'windows-latest' | |
| args: '' | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ env.GITHUB_TOKEN }} | |
| - name: Node.js setup ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
| - name: Install dependencies (ubuntu only) | |
| if: matrix.os == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pkg-config libudev-dev javascriptcoregtk-4.1 libsoup-3.0 libwebkit2gtk-4.0-dev libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev webkit2gtk-4.0 patchelf libsoup2.4-dev | |
| npm install -g pnpm | |
| npm install -g typescript | |
| - name: install dependencies (windows only) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| npm install -g typescript | |
| npm install -g pnpm | |
| - name: install dependencies (macos only) | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew install pnpm | |
| - name: Install frontend dependencies (PNPM) | |
| run: pnpm install --no-frozen-lockfile | |
| - name: Generate Local Plugins (PNPM) | |
| run: pnpm run specta:gen | |
| - uses: tauri-apps/tauri-action@v0.6.1 | |
| id: tauri_build | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
| TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
| with: | |
| args: ${{ matrix.args }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: production-files-${{ matrix.os }} | |
| path: "${{ join(fromJSON(steps.tauri_build.outputs.artifactPaths), '\n') }}" | |
| deploy: | |
| runs-on: ubuntu-latest | |
| name: Deploy | |
| needs: [build] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create Directory | |
| run: mkdir -p dist | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: production-files-* | |
| path: ./dist | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| # remember to update the conventionalcommits version when updating semantic release | |
| - run: npm install -g conventional-changelog-conventionalcommits@8 | |
| - run: npm install -g semantic-release@v24.1.2 | |
| - run: npm install -g @semantic-release/exec | |
| - run: npm install -g @semantic-release/git | |
| - run: npm install -g @semantic-release/release-notes-generator | |
| - run: npm install -g @semantic-release/changelog | |
| - run: npm install -g @semantic-release/github | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| sudo apt-get install -y jq | |
| chmod +x ./.github/scripts/prepareCMD.sh | |
| semantic-release | |
| cleanup: | |
| name: Cleanup actions | |
| needs: | |
| - deploy | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: '♻️ remove build artifacts' | |
| uses: geekyeggo/delete-artifact@v5 | |
| with: | |
| name: production-files |