From 90395c8ba4febb72ce618acdd7d4540937ed676d Mon Sep 17 00:00:00 2001 From: CJ Pais Date: Tue, 19 Aug 2025 19:29:28 -0700 Subject: [PATCH] fix? --- .github/workflows/build.yml | 33 ++++++++------------------------- .github/workflows/release.yml | 30 ++++++++++-------------------- 2 files changed, 18 insertions(+), 45 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f638121..2065a27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,23 +49,13 @@ jobs: ref: ${{ inputs.ref }} fetch-depth: 0 - - name: Determine Version - id: determine-version + - name: Get version from tauri.conf.json + id: get-version shell: bash run: | - APP_VERSION="" - REF="${{ inputs.ref }}" - - if [[ "$REF" == refs/tags/v* ]]; then - APP_VERSION="${REF#refs/tags/v}" - echo "Release version determined from tag: $APP_VERSION" - else - DESCRIBE=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") - APP_VERSION="${DESCRIBE#v}" - echo "CI version determined from latest tag or fallback: $APP_VERSION" - fi - - echo "version=${APP_VERSION}" >> "$GITHUB_OUTPUT" + 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" - uses: oven-sh/setup-bun@v2 @@ -79,7 +69,7 @@ jobs: uses: swatinem/rust-cache@v2 with: workspaces: "./src-tauri -> target" - key: ${{ inputs.platform }}-${{ inputs.target }}-whisper-rs-0.14.4 + key: ${{ inputs.platform }}-${{ inputs.target }} - name: install dependencies (ubuntu 24.04) if: contains(inputs.platform, 'ubuntu-24.04') @@ -159,13 +149,6 @@ jobs: echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV echo "Certificate imported." - - name: Set application version - shell: bash - run: | - echo "Setting version to: ${{ steps.determine-version.outputs.version }}" - # Update version in tauri.conf.json - sed -i.bak 's/"version": "[^"]*"/"version": "${{ steps.determine-version.outputs.version }}"/' src-tauri/tauri.conf.json - - name: Build with Tauri uses: tauri-apps/tauri-action@v0 env: @@ -183,8 +166,8 @@ jobs: TAURI_SIGNING_PRIVATE_KEY: ${{ inputs.sign-binaries && secrets.TAURI_SIGNING_PRIVATE_KEY || '' }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ inputs.sign-binaries && secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD || '' }} with: - tagName: ${{ inputs.release-id && format('v{0}', steps.determine-version.outputs.version) || '' }} - releaseName: ${{ inputs.release-id && format('v{0}', steps.determine-version.outputs.version) || '' }} + tagName: ${{ inputs.release-id && format('v{0}', steps.get-version.outputs.version) || '' }} + releaseName: ${{ inputs.release-id && format('v{0}', steps.get-version.outputs.version) || '' }} releaseId: ${{ inputs.release-id }} args: ${{ inputs.build-args }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41f5d58..ed07936 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,30 +9,18 @@ jobs: runs-on: ubuntu-latest outputs: release-id: ${{ steps.create-release.outputs.result }} - version: ${{ steps.determine-version.outputs.version }} + version: ${{ steps.get-version.outputs.version }} steps: - name: Checkout repository uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Determine Version - id: determine-version + - name: Get version from tauri.conf.json + id: get-version shell: bash run: | - APP_VERSION="" - REF="${{ github.ref }}" - - if [[ "$REF" == refs/tags/v* ]]; then - APP_VERSION="${REF#refs/tags/v}" - echo "Release version determined from tag: $APP_VERSION" - else - DESCRIBE=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") - APP_VERSION="${DESCRIBE#v}" - echo "CI version determined from latest tag or fallback: $APP_VERSION" - fi - - echo "version=${APP_VERSION}" >> "$GITHUB_OUTPUT" + 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 Draft Release id: create-release @@ -42,8 +30,8 @@ jobs: const { data } = await github.rest.repos.createRelease({ owner: context.repo.owner, repo: context.repo.repo, - tag_name: `v${{ steps.determine-version.outputs.version }}`, - name: `v${{ steps.determine-version.outputs.version }}`, + tag_name: `v${{ steps.get-version.outputs.version }}`, + name: `v${{ steps.get-version.outputs.version }}`, draft: true, prerelease: false, generate_release_notes: true @@ -80,4 +68,6 @@ jobs: asset-prefix: "handy" upload-artifacts: false release-id: ${{ needs.create-release.outputs.release-id }} + tag-name: "v${{ needs.create-release.outputs.version }}" + release-name: "v${{ needs.create-release.outputs.version }}" secrets: inherit