Skip to content

Commit d31e8f0

Browse files
Update release workflow for pre-releases handling
1 parent 5dfa300 commit d31e8f0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
push:
77
tags:
88
- 'v*.*.*'
9+
- 'v*.*.*-*' # also handle pre-releases like v1.2.3-beta.1
910

1011
permissions:
1112
contents: write
@@ -36,14 +37,12 @@ jobs:
3637

3738
- name: Commit and Update Tag
3839
run: |
39-
git config --global user.name 'github-actions[bot]'
40-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
40+
git config --global user.name 'CodeTranslate Release Bot'
41+
git config --global user.email 'release-bot-codetranslate@users.noreply.github.com'
4142
git add frontend/manifest.json
4243
# This command updates the tag to point to the new commit
43-
git commit -m "chore: Bump frontend version to ${{ github.ref_name }}"
44-
# Force push is required to move the tag to the new commit,
45-
# which includes the manifest.json version bump.
46-
git push origin --force ${{ github.ref_name }}
44+
git commit -m "chore: bump manifest version to ${{ github.ref_name }} [skip ci]" || echo "No changes to commit"
45+
git push origin HEAD:main
4746
4847
- name: Build frontend extension
4948
run: npm run build
@@ -60,4 +59,5 @@ jobs:
6059
tag_name: ${{ github.ref_name }}
6160
draft: true
6261
generate_release_notes: true
63-
files: CodeTranslateAI-${{ github.ref_name }}.zip
62+
files: CodeTranslateAI-${{ github.ref_name }}.zip
63+
prerelease: ${{ contains(github.ref_name, '-') }}

0 commit comments

Comments
 (0)