fix(release): normalize package artifact version

This commit is contained in:
Zeno Jiricek
2026-08-18 22:22:55 +09:30
parent 9c45eadd9e
commit 11809502ee
+18 -4
View File
@@ -68,10 +68,14 @@ jobs:
echo "version=$version" >> "$GITHUB_OUTPUT" echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Set package version - name: Set package version
id: package
shell: bash shell: bash
env: env:
VERSION: ${{ steps.version.outputs.version }} VERSION: ${{ steps.version.outputs.version }}
run: npm version "$VERSION" --no-git-tag-version --allow-same-version run: |
npm version "$VERSION" --no-git-tag-version --allow-same-version
version=$(node -p "require('./package.json').version")
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
@@ -89,7 +93,7 @@ jobs:
if: matrix.platform == 'windows' if: matrix.platform == 'windows'
shell: pwsh shell: pwsh
env: env:
VERSION: ${{ steps.version.outputs.version }} VERSION: ${{ steps.package.outputs.version }}
run: | run: |
$required = @( $required = @(
"dist/desktop/SketchForge-Setup-$env:VERSION-x64.exe", "dist/desktop/SketchForge-Setup-$env:VERSION-x64.exe",
@@ -106,7 +110,7 @@ jobs:
if: matrix.platform == 'linux' if: matrix.platform == 'linux'
shell: bash shell: bash
env: env:
VERSION: ${{ steps.version.outputs.version }} VERSION: ${{ steps.package.outputs.version }}
run: | run: |
test -f "dist/desktop/SketchForge-$VERSION-x86_64.AppImage" test -f "dist/desktop/SketchForge-$VERSION-x86_64.AppImage"
test -f dist/desktop/latest-linux.yml test -f dist/desktop/latest-linux.yml
@@ -167,6 +171,16 @@ jobs:
echo "version=$version" >> "$GITHUB_OUTPUT" echo "version=$version" >> "$GITHUB_OUTPUT"
echo "tag=$tag" >> "$GITHUB_OUTPUT" echo "tag=$tag" >> "$GITHUB_OUTPUT"
- name: Normalize package version
id: package
shell: bash
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
npm version "$VERSION" --no-git-tag-version --allow-same-version
version=$(node -p "require('./package.json').version")
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Ensure release tag exists - name: Ensure release tag exists
if: github.event_name == 'workflow_dispatch' if: github.event_name == 'workflow_dispatch'
env: env:
@@ -223,7 +237,7 @@ jobs:
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.version.outputs.tag }} TAG: ${{ steps.version.outputs.tag }}
VERSION: ${{ steps.version.outputs.version }} VERSION: ${{ steps.package.outputs.version }}
run: | run: |
assets=$(gh release view "$TAG" --json isDraft,assets) assets=$(gh release view "$TAG" --json isDraft,assets)
test "$(jq -r '.isDraft' <<< "$assets")" = "true" test "$(jq -r '.isDraft' <<< "$assets")" = "true"