ci: Update version setup action to support desktop and mobile app ver… (#2957)

This commit is contained in:
Innei
2025-03-04 15:33:44 +08:00
committed by GitHub
2 changed files with 12 additions and 1 deletions
+10 -1
View File
@@ -1,5 +1,10 @@
name: Setup Version
description: "Setup Version"
inputs:
type:
required: true
description: "Type of the app, either 'desktop' or 'mobile'"
default: "desktop"
outputs:
APP_VERSION:
description: "App Version"
@@ -14,7 +19,11 @@ runs:
if [ "${{ github.ref_type }}" == "tag" ]; then
APP_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
else
APP_VERSION=$(node -p "require('./package.json').version")
if [ "${{ inputs.type }}" == "desktop" ]; then
APP_VERSION=$(node -p "require('./apps/desktop/package.json').version")
else
APP_VERSION=$(node -p "require('./apps/mobile/package.json').version")
fi
fi
echo $APP_VERSION
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_OUTPUT"
+2
View File
@@ -223,6 +223,8 @@ jobs:
- name: Setup Version
id: version
uses: ./.github/actions/setup-version
with:
type: "desktop"
- name: Create Release Draft
if: github.ref_type == 'tag' || github.event.inputs.tag_version == 'true'