Skip to content

Commit 941b50b

Browse files
committed
Add: create and push Git tag for version release in work-jar.yml
1 parent a9eb625 commit 941b50b

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/work-jar.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,30 @@ jobs:
99
steps:
1010
- name: Checkout code
1111
uses: actions/checkout@v4
12-
12+
1313
- name: Set up JDK 17
1414
uses: actions/setup-java@v4
1515
with:
1616
java-version: '17'
1717
distribution: 'temurin'
18-
18+
1919
- name: Grant execute permission for gradlew
2020
run: chmod +x gradlew
21-
21+
2222
- name: Extract version from build.gradle.kts
2323
id: extract_version
2424
run: |
2525
VERSION=$(./gradlew -q printVersion)
2626
echo "version=$VERSION" >> $GITHUB_OUTPUT
2727
echo "Extracted version: $VERSION"
28-
28+
2929
- name: Publish Maven artifacts to local repo
3030
run: ./gradlew publish
3131
env:
3232
GROUP_ID: fr.sandro642.github
3333
ARTIFACT_ID: ConnectorAPI
3434
VERSION: ${{ steps.extract_version.outputs.version }}
35-
35+
3636
- name: Deploy to GitHub Pages
3737
uses: JamesIves/github-pages-deploy-action@v4
3838
with:
@@ -41,3 +41,12 @@ jobs:
4141
branch: main
4242
folder: build/repo
4343
target-folder: connectorapi/jar
44+
45+
- name: Create Git tag
46+
run: |
47+
git config --local user.email "action@github.com"
48+
git config --local user.name "GitHub Action"
49+
git tag -a "${{ steps.extract_version.outputs.version }}" -m "Release version ${{ steps.extract_version.outputs.version }}"
50+
git push origin "${{ steps.extract_version.outputs.version }}"
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)