Skip to content

Commit

Permalink
chore: update release check
Browse files Browse the repository at this point in the history
  • Loading branch information
hexf00 committed Dec 19, 2024
1 parent 8bc2c05 commit 9e36cc2
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,18 @@ jobs:
if [ -z "${{ inputs.version }}" ]; then
cd app
APP_VERSION=$(node -e 'console.log(require("./package.json").version)')
COMMIT_HASH=$(git rev-parse --short=7 HEAD)
# get dev release count
DEV_RELEASES=$(gh release list -R ${{ github.repository }} --limit 100 | grep "${APP_VERSION}-dev" | wc -l)
BUILD_NUMBER=$((DEV_RELEASES + 1))
echo "version=${APP_VERSION}-dev.${BUILD_NUMBER}-${COMMIT_HASH}" >> $GITHUB_OUTPUT
if [ ${{ github.repository }} = "dream-num/univer-go" ]; then
echo "version=${APP_VERSION}" >> $GITHUB_OUTPUT
else
COMMIT_HASH=$(git rev-parse --short=7 HEAD)
# get dev release count
DEV_RELEASES=$(gh release list -R ${{ github.repository }} --limit 100 | grep "${APP_VERSION}-dev" | wc -l)
BUILD_NUMBER=$((DEV_RELEASES + 1))
echo "version=${APP_VERSION}-dev.${BUILD_NUMBER}-${COMMIT_HASH}" >> $GITHUB_OUTPUT
fi
else
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
fi
Expand All @@ -94,6 +99,14 @@ jobs:
echo "is_stable=false" >> $GITHUB_OUTPUT
fi
- name: Check version
if: ${{ github.repository == 'dream-num/univer-go' }}
shell: bash
run: |
if [ ${{ steps.version_type.outputs.is_dev }} = "true" ]; then
exit 1
fi
- name: Determine release channel
id: release_channel
shell: bash
Expand Down

0 comments on commit 9e36cc2

Please sign in to comment.