Skip to content

Commit e0cf1c7

Browse files
committed
ci(gh-actions): add change tag job
1 parent 55ca81d commit e0cf1c7

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,22 @@ on:
77
jobs:
88
release:
99
name: Release
10+
if: github.event.release.prerelease == false
1011
runs-on: ubuntu-latest
1112
steps:
12-
- name: Release for GitHub Actions
13-
uses: technote-space/[email protected]
14-
with:
15-
BRANCH_NAME: releases/${MAJOR}
16-
BUILD_COMMAND: npm ci --ignore-scripts && npm run build && npm pkg delete scripts.prepare
17-
CLEAN_TARGETS: .[!.]*,test,coverage,node_modules,src,*.js,*.ts,*.json,*.lock,_config.yml
18-
COMMIT_MESSAGE: 'build: release ${{ github.event.release.tag_name }} via ${{ github.sha }}'
13+
- name: Checkout
14+
uses: actions/[email protected]
15+
16+
- name: Get Major & Minor version
17+
id: version
18+
run: |
19+
echo "major=$(echo ${{ github.event.release.tag_name }} | cut -d. -f1)" >> $GITHUB_OUTPUT
20+
echo "minor=$(echo ${{ github.event.release.tag_name }} | cut -d. -f2)" >> $GITHUB_OUTPUT
21+
22+
- name: Push Git Tag (Major, Minor)
23+
run: |
24+
git config user.name github-actions[bot]
25+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
26+
git tag -a ${{ steps.version.outputs.major }}
27+
git tag -a ${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}
28+
git push --tags --force

0 commit comments

Comments
 (0)