Update dependencies #6
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: Build app. | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| node-version: | |
| - 22.x | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: 🗄️ Setup Rust cache | |
| uses: actions/cache@v4 | |
| with: | |
| key: ${{ matrix.os }}-${{ hashFiles('src-tauri/Cargo.lock') }} | |
| path: | | |
| ~/.cargo/registry/index | |
| ~/.cargo/registry/cache | |
| ~/.cargo/git | |
| ./src-tauri/target | |
| - name: 🦀 Install Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: { toolchain: stable } | |
| - name: 🌐 Update MSEdge webdriver (windowsonly) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| choco upgrade microsoft-edge | |
| - name: 🌐 Install webkit2gtk (ubuntu only) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get upgrade -y \ | |
| libwebkit2gtk-4.1-dev \ | |
| build-essential \ | |
| curl \ | |
| wget \ | |
| file \ | |
| libxdo-dev \ | |
| libssl-dev \ | |
| libayatana-appindicator3-dev \ | |
| librsvg2-dev | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| cache: true | |
| - name: 🟢 Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: 🔌 Install Node.js dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 🔌 Download Rust dependencies | |
| working-directory: src-tauri | |
| run: cargo fetch | |
| - name: 🏗️ 💽 Build application | |
| run: pnpm run tauri build | |
| - name: 🧪 Test backend application | |
| continue-on-error: true | |
| working-directory: src-tauri | |
| run: | | |
| cargo test | |
| - name: 🗃 Store Linux artifacts (release only) | |
| uses: actions/upload-artifact@v4 | |
| if: matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/v') | |
| with: | |
| name: pos_sum_artifacts_${{ matrix.os }} | |
| overwrite: true | |
| path: | | |
| src-tauri/target/release/pos_sum | |
| src-tauri/target/release/bundle/deb/*.deb | |
| - name: 🗃 Store Windows artifacts (release only) | |
| uses: actions/upload-artifact@v4 | |
| if: matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/v') | |
| with: | |
| name: pos_sum_artifacts_${{ matrix.os }} | |
| overwrite: true | |
| path: | | |
| src-tauri/target/release/pos_sum.exe | |
| src-tauri/target/release/bundle/msi/*.msi | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: 🗃 Download built artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: src-tauri/target/release | |
| merge-multiple: true | |
| - name: Upload Windows executable | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: src-tauri/target/release/pos_sum.exe | |
| asset_name: pos_sum_${{ github.ref_name }}.exe | |
| tag: ${{ github.ref_name }} | |
| overwrite: true | |
| file_glob: true | |
| - name: Upload Windows installer | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: src-tauri/target/release/bundle/msi/pos_sum_*.msi | |
| asset_name: pos_sum_${{ github.ref_name }}_installer.msi | |
| tag: ${{ github.ref_name }} | |
| overwrite: true | |
| file_glob: true | |
| - name: Upload Linux executable | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: src-tauri/target/release/pos_sum | |
| asset_name: pos_sum_${{ github.ref_name }} | |
| tag: ${{ github.ref_name }} | |
| overwrite: true | |
| file_glob: true | |
| - name: Upload Linux deb package | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: src-tauri/target/release/bundle/deb/pos_sum_*.deb | |
| asset_name: pos_sum_${{ github.ref_name }}.deb | |
| tag: ${{ github.ref_name }} | |
| overwrite: true | |
| file_glob: true |