ci: use setup version action to init version (#5365)

1. Create  setup version action to unify version initialization
2. Split tag event from release desktop
3. Add schedule to daily deploy and desktop release
This commit is contained in:
Joooye_34
2023-12-21 07:58:16 +00:00
parent cc73124259
commit fb1ed90ecc
6 changed files with 109 additions and 69 deletions

View File

@@ -0,0 +1,20 @@
name: Setup Version
description: 'Setup Version'
runs:
using: 'composite'
steps:
- name: 'Write Version'
id: version
shell: bash
run: |
if [ "${{ github.ref_type }}" == "tag" ]; then
APP_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
else
PACKAGE_VERSION=$(node -p "require('./package.json').version")
TIME_VERSION=$(date +%Y%m%d%H%M)
GIT_SHORT_HASH=$(git rev-parse --short HEAD)
APP_VERSION=$PACKAGE_VERSION-nightly-$TIME_VERSION-$GIT_SHORT_HASH
fi
echo $APP_VERSION
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_OUTPUT"
./scripts/set-version.sh $APP_VERSION