Release #15
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: "Release" | |
| on: workflow_dispatch | |
| jobs: | |
| create-release: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release-id: ${{ steps.create-release.outputs.result }} | |
| version: ${{ steps.get-version.outputs.version }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for tag comparison | |
| - name: Get version from tauri.conf.json | |
| id: get-version | |
| shell: bash | |
| run: | | |
| VERSION=$(grep -o '"version": "[^"]*"' src-tauri/tauri.conf.json | cut -d'"' -f4) | |
| echo "Application version from tauri.conf.json: $VERSION" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Create and push tag | |
| shell: bash | |
| run: | | |
| TAG_NAME="v${{ steps.get-version.outputs.version }}" | |
| # Check if tag already exists | |
| if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then | |
| echo "Tag $TAG_NAME already exists, skipping tag creation" | |
| else | |
| echo "Creating tag $TAG_NAME" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag -a "$TAG_NAME" -m "Release $TAG_NAME" | |
| git push origin "$TAG_NAME" | |
| fi | |
| - name: Create Draft Release | |
| id: create-release | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { data } = await github.rest.repos.createRelease({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| tag_name: `v${{ steps.get-version.outputs.version }}`, | |
| name: `v${{ steps.get-version.outputs.version }}`, | |
| draft: true, | |
| prerelease: false, | |
| generate_release_notes: true | |
| }) | |
| return data.id | |
| publish-tauri: | |
| permissions: | |
| contents: write | |
| needs: create-release | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: "macos-latest" # for Arm based macs (M1 and above). | |
| args: "--target aarch64-apple-darwin" | |
| target: "aarch64-apple-darwin" | |
| - platform: "macos-latest" # for Intel based macs. | |
| args: "--target x86_64-apple-darwin" | |
| target: "x86_64-apple-darwin" | |
| - platform: "ubuntu-22.04" # Build .deb on 22.04 | |
| args: "--bundles deb" | |
| target: "x86_64-unknown-linux-gnu" | |
| - platform: "ubuntu-24.04" # Build AppImage and RPM on 24.04 | |
| args: "--bundles appimage,rpm" | |
| target: "x86_64-unknown-linux-gnu" | |
| - platform: "windows-latest" | |
| args: "" | |
| target: "x86_64-pc-windows-msvc" | |
| - platform: "windows-11-arm" # for ARM64 Windows runner | |
| args: "--target aarch64-pc-windows-msvc" | |
| target: "aarch64-pc-windows-msvc" | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| platform: ${{ matrix.platform }} | |
| target: ${{ matrix.target }} | |
| build-args: ${{ matrix.args }} | |
| # TODO: Setup windows signing | |
| # sign-binaries: true | |
| sign-binaries: ${{ !contains(matrix.platform, 'windows') }} | |
| asset-prefix: "echo" | |
| upload-artifacts: false | |
| release-id: ${{ needs.create-release.outputs.release-id }} | |
| secrets: inherit |