|
| 1 | +name: "Publish Tauri App" |
| 2 | +on: |
| 3 | + release: |
| 4 | + types: [published] |
| 5 | + |
| 6 | +jobs: |
| 7 | + publish-tauri: |
| 8 | + strategy: |
| 9 | + fail-fast: false |
| 10 | + matrix: |
| 11 | + platform: [macos-latest, ubuntu-latest, windows-latest] |
| 12 | + |
| 13 | + runs-on: ${{ matrix.platform }} |
| 14 | + steps: |
| 15 | + - name: Checkout repository |
| 16 | + |
| 17 | + with: |
| 18 | + submodules: true |
| 19 | + - name: Get release |
| 20 | + id: get_release |
| 21 | + uses: bruceadams/get-release@3a8733307b85cd96d52772b037617bd63d99522e |
| 22 | + env: |
| 23 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 24 | + - name: Setup node |
| 25 | + |
| 26 | + with: |
| 27 | + node-version: 16 |
| 28 | + - name: Install Rust stable |
| 29 | + uses: actions-rs/[email protected] |
| 30 | + with: |
| 31 | + toolchain: stable |
| 32 | + - name: Install webkit2gtk (ubuntu only) |
| 33 | + if: matrix.platform == 'ubuntu-latest' |
| 34 | + run: | |
| 35 | + sudo apt-get update |
| 36 | + sudo apt-get install -y webkit2gtk-4.0 |
| 37 | + - name: Install cinny dependencies |
| 38 | + run: cd cinny && npm ci |
| 39 | + - name: Install tauri dependencies |
| 40 | + run: npm ci |
| 41 | + - name: Build desktop app with Tauri |
| 42 | + uses: tauri-apps/[email protected] |
| 43 | + env: |
| 44 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 45 | + TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} |
| 46 | + with: |
| 47 | + releaseId: ${{ steps.get_release.outputs.upload_url }} |
| 48 | + - name: Get app version (macos, ubuntu) |
| 49 | + if: matrix.platform != 'windows-latest' |
| 50 | + id: vars |
| 51 | + run: echo ::set-output name=tag::$(jq .package.version src-tauri/tauri.conf.json | tr -d '"') |
| 52 | + - name: Upload tagged release (macos) |
| 53 | + if: matrix.platform == 'macos-latest' |
| 54 | + uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 |
| 55 | + with: |
| 56 | + files: | |
| 57 | + src-tauri/target/release/bundle/dmg/cinny_${{ steps.vars.outputs.tag }}_x64.dmg |
| 58 | + src-tauri/target/release/bundle/macos/cinny.app.tar.gz |
| 59 | + src-tauri/target/release/bundle/macos/cinny.app.tar.gz.sig |
| 60 | + - name: Upload tagged release (ubuntu) |
| 61 | + if: matrix.platform == 'ubuntu-latest' |
| 62 | + uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 |
| 63 | + with: |
| 64 | + files: | |
| 65 | + src-tauri/target/release/bundle/deb/cinny_${{ steps.vars.outputs.tag }}_amd64.deb |
| 66 | + src-tauri/target/release/bundle/appimage/cinny_${{ steps.vars.outputs.tag }}_amd64.AppImage |
| 67 | + src-tauri/target/release/bundle/appimage/cinny_${{ steps.vars.outputs.tag }}_amd64.AppImage.tar.gz |
| 68 | + src-tauri/target/release/bundle/appimage/cinny_${{ steps.vars.outputs.tag }}_amd64.AppImage.tar.gz.sig |
| 69 | + - name: Get app version (windows) |
| 70 | + if: matrix.platform == 'windows-latest' |
| 71 | + run: | |
| 72 | + $json = (Get-Content "src-tauri\tauri.conf.json" -Raw) | ConvertFrom-Json |
| 73 | + $version = $json.package.version |
| 74 | + echo "Version: ${version}" |
| 75 | + echo "TAURI_VERSION=${version}" >> $Env:GITHUB_ENV |
| 76 | + echo "${Env:TAURI_VERSION}" |
| 77 | + shell: pwsh |
| 78 | + - name: Upload tagged release (windows) |
| 79 | + if: matrix.platform == 'windows-latest' |
| 80 | + uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 |
| 81 | + with: |
| 82 | + files: | |
| 83 | + src-tauri\target\release\bundle\msi\cinny_${{ env.TAURI_VERSION }}_x64_en-US.msi |
| 84 | + src-tauri\target\release\bundle\msi\cinny_${{ env.TAURI_VERSION }}_x64_en-US.msi.zip |
| 85 | + src-tauri\target\release\bundle\msi\cinny_${{ env.TAURI_VERSION }}_x64_en-US.msi.zip.sig |
| 86 | +
|
| 87 | + release-update: |
| 88 | + needs: publish-tauri |
| 89 | + runs-on: ubuntu-latest |
| 90 | + steps: |
| 91 | + - name: Checkout repository |
| 92 | + |
| 93 | + - name: Install dependencies |
| 94 | + run: npm ci |
| 95 | + - name: Run release.json |
| 96 | + run: npm run release |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments