This commit is contained in:
octopus_yan 2024-09-18 03:44:50 +08:00
parent 325b838a4f
commit e7a6f45814

View File

@ -24,6 +24,17 @@ jobs:
path: temp
show-progress: false
- name: Fetch history
if: ${{ !startsWith(github.ref, 'refs/pull/') }}
run: |
git init
cp $GITHUB_WORKSPACE/temp/.git/config ./.git
rm -rf $GITHUB_WORKSPACE/temp
# git config remote.origin.fetch '+refs/*:refs/*'
git fetch --filter=tree:0 # --update-head-ok
git reset --hard origin/$(git branch --show-current) || true
git checkout ${{ github.ref_name }}
- name: Set tag
id: set_tag
run: |
@ -31,6 +42,16 @@ jobs:
echo tag=$(git describe --tags --match "v*" ${{ github.ref }} || git rev-parse --short HEAD) | tee -a $GITHUB_OUTPUT
exit ${PIPESTATUS[0]}
- name: Judge pre-release
id: set_pre
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
if [[ '${{ steps.set_tag.outputs.tag }}' =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo prerelease=false | tee -a $GITHUB_OUTPUT
else
echo prerelease=true | tee -a $GITHUB_OUTPUT
fi
- name: Set up Node.js
uses: actions/setup-node@v4
with: