Skip to content

Commit 46da9f5

Browse files
authored
Update work-jar.yml
1 parent 8116191 commit 46da9f5

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/work-jar.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
11
name: Publish JAR to GitHub Pages
2-
32
on:
43
push:
54
branches:
65
- main
7-
86
jobs:
97
publish-jar:
108
runs-on: ubuntu-latest
11-
129
steps:
1310
- name: Checkout code
1411
uses: actions/checkout@v4
15-
12+
1613
- name: Set up JDK 17
1714
uses: actions/setup-java@v4
1815
with:
1916
java-version: '17'
2017
distribution: 'temurin'
21-
18+
2219
- name: Grant execute permission for gradlew
2320
run: chmod +x gradlew
24-
21+
22+
- name: Extract version from build.gradle.kts
23+
id: extract_version
24+
run: |
25+
VERSION=$(./gradlew -q printVersion)
26+
echo "version=$VERSION" >> $GITHUB_OUTPUT
27+
echo "Extracted version: $VERSION"
28+
2529
- name: Publish Maven artifacts to local repo
2630
run: ./gradlew publish
2731
env:
2832
GROUP_ID: fr.sandro642.github
2933
ARTIFACT_ID: ConnectorAPI
30-
VERSION: 0.1.0
31-
34+
VERSION: ${{ steps.extract_version.outputs.version }}
35+
3236
- name: Deploy to GitHub Pages
3337
uses: JamesIves/github-pages-deploy-action@v4
3438
with:

0 commit comments

Comments
 (0)