|
| 1 | +name: Release |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: write |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + tags: |
| 9 | + - "v*" |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +jobs: |
| 13 | + create-release: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v3 |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + submodules: recursive |
| 20 | + |
| 21 | + - name: Set output |
| 22 | + id: vars |
| 23 | + run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT |
| 24 | + |
| 25 | + - name: Setup node |
| 26 | + uses: actions/setup-node@v3 |
| 27 | + with: |
| 28 | + node-version: 16.x |
| 29 | + |
| 30 | + - name: Generate changelog |
| 31 | + id: create_release |
| 32 | + run: npx changelogithub --draft --name pntools-${{ steps.vars.outputs.tag }} |
| 33 | + env: |
| 34 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 35 | + |
| 36 | + build-app: |
| 37 | + needs: create-release |
| 38 | + strategy: |
| 39 | + fail-fast: false |
| 40 | + matrix: |
| 41 | + platform: [macos-latest, ubuntu-20.04, windows-latest] |
| 42 | + |
| 43 | + runs-on: ${{ matrix.platform }} |
| 44 | + |
| 45 | + steps: |
| 46 | + - name: Checkout repository |
| 47 | + uses: actions/checkout@v3 |
| 48 | + - uses: pnpm/action-setup@v2 |
| 49 | + with: |
| 50 | + version: latest |
| 51 | + |
| 52 | + - name: install dependencies (ubuntu only) |
| 53 | + if: matrix.platform == 'ubuntu-20.04' |
| 54 | + run: | |
| 55 | + sudo apt-get update |
| 56 | + sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev |
| 57 | +
|
| 58 | + - name: install dependencies (mac only) |
| 59 | + if: matrix.platform == 'macos-latest' |
| 60 | + run: | |
| 61 | + rustup target add aarch64-apple-darwin |
| 62 | + brew install g++ |
| 63 | +
|
| 64 | + - name: Install Rust stable |
| 65 | + uses: dtolnay/rust-toolchain@stable |
| 66 | + |
| 67 | + - name: Rust cache |
| 68 | + uses: swatinem/rust-cache@v2 |
| 69 | + with: |
| 70 | + workspaces: "./src-tauri -> target" |
| 71 | + |
| 72 | + - name: Sync node version and setup cache |
| 73 | + uses: actions/setup-node@v3 |
| 74 | + with: |
| 75 | + node-version: "16" |
| 76 | + cache: "pnpm" |
| 77 | + |
| 78 | + - name: Install app dependencies and build web |
| 79 | + run: pnpm install --frozen-lockfile |
| 80 | + |
| 81 | + - name: Build the app |
| 82 | + uses: tauri-apps/tauri-action@v0 |
| 83 | + env: |
| 84 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 85 | + with: |
| 86 | + tagName: ${{ github.ref_name }} |
| 87 | + releaseName: pntools ${{ needs.create-release.outputs.APP_VERSION }} |
| 88 | + releaseBody: "" |
| 89 | + releaseDraft: true |
| 90 | + prerelease: false |
0 commit comments