Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/linux-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@ jobs:
- name: write version files
env:
DISPATCH_VERSION: ${{ inputs.version }}
# github.ref_name (evaluated by Actions) instead of $GITHUB_REF_NAME,
# which is only injected by runner >= 2.290 — empty on older
# self-hosted runners.
REF_NAME: ${{ github.ref_name }}
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${DISPATCH_VERSION#v}"
else
VERSION="${GITHUB_REF_NAME#v}"
VERSION="${REF_NAME#v}"
fi
if [ -z "$VERSION" ]; then
echo "Could not determine a version" >&2
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/macos-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ jobs:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: write version files
env:
# github.ref_name (evaluated by Actions) instead of $GITHUB_REF_NAME,
# which is only injected by runner >= 2.290 — empty on older
# self-hosted runners.
REF_NAME: ${{ github.ref_name }}
run: |
if [ -z "${GITHUB_REF_NAME:-}" ]; then
echo "GITHUB_REF_NAME is not set" >&2
if [ -z "${REF_NAME:-}" ]; then
echo "REF_NAME is not set" >&2
exit 1
fi
VERSION="${GITHUB_REF_NAME#v}"
VERSION="${REF_NAME#v}"
printf '{ "version": "%s" }\n' "$VERSION" > static/version.json
sed -i '' "s/^version = \".*\"/version = \"$VERSION\"/" desktop/src-tauri/Cargo.toml
sed -i '' "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/" desktop/src-tauri/tauri.conf.json
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/windows-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ jobs:
timeout-minutes: 90
permissions:
contents: write
# Source the tag from the github context (evaluated by Actions) rather than
# $env:GITHUB_REF_NAME, which is only injected by runner >= 2.290. Keeps the
# build working on older self-hosted runners. (#212 follow-up)
env:
REF_NAME: ${{ github.ref_name }}
defaults:
run:
shell: powershell
Expand All @@ -29,8 +34,8 @@ jobs:

- name: write version files
run: |
$tag = $env:GITHUB_REF_NAME
if (-not $tag) { throw "GITHUB_REF_NAME is not set" }
$tag = $env:REF_NAME
if (-not $tag) { throw "REF_NAME is not set" }
$version = $tag -replace '^v', ''
$json = "{`"version`": `"$version`"}"
Set-Content -Path "static/version.json" -Value $json -Encoding UTF8
Expand All @@ -48,14 +53,14 @@ jobs:
run: |
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/windows/make-portable.ps1 `
-PackageName StemDeck-Windows-x64.NVIDIA `
-PackageVersion "$env:GITHUB_REF_NAME" `
-PackageVersion "$env:REF_NAME" `
-StripVenv

- name: build Windows CPU
run: |
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/windows/make-portable.ps1 `
-PackageName StemDeck-Windows-x64 `
-PackageVersion "$env:GITHUB_REF_NAME" `
-PackageVersion "$env:REF_NAME" `
-CpuOnly `
-StripVenv

Expand Down