This commit is contained in:
CJ Pais 2025-08-19 19:29:28 -07:00
parent 425dd11b25
commit 90395c8ba4
2 changed files with 18 additions and 45 deletions

View file

@ -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 }}

View file

@ -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