ci: Update version setup action to support desktop and mobile app versioning
- Add input parameter to specify app type (desktop or mobile) - Modify version extraction logic to use correct package.json based on app type - Update build workflow to explicitly set app type when setting up version Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user