File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Dev Build
1+ name : Publish Snapshot to GitHub Packages
22
33on :
44 push :
55 branches :
66 - dev
77
88jobs :
9- build :
9+ snapshot :
1010 runs-on : ubuntu-latest
1111
12+ permissions :
13+ contents : read
14+ packages : write
15+
1216 steps :
1317 - name : Checkout code
1418 uses : actions/checkout@v4
@@ -19,13 +23,22 @@ jobs:
1923 distribution : temurin
2024 java-version : ' 17'
2125 cache : maven
26+ server-id : github
27+ server-username : GITHUB_ACTOR
28+ server-password : GITHUB_TOKEN
29+
30+ - name : Set snapshot version
31+ run : |
32+ VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
33+ if [[ ! "$VERSION" == *"-SNAPSHOT" ]]; then
34+ mvn versions:set -DnewVersion="${VERSION}-SNAPSHOT" -DgenerateBackupPoms=false
35+ fi
2236
2337 - name : Build and test
2438 run : mvn -B clean verify
2539
26- - name : Upload build artifacts
27- uses : actions/upload-artifact@v4
28- with :
29- name : endee-java-client-dev
30- path : target/*.jar
31- retention-days : 7
40+ - name : Publish to GitHub Packages
41+ run : mvn -B deploy -DskipTests
42+ env :
43+ GITHUB_ACTOR : ${{ github.actor }}
44+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 174174
175175 <distributionManagement >
176176 <snapshotRepository >
177- <id >central-snapshots </id >
178- <url >https://s01.oss.sonatype.org/content/repositories/snapshots/ </url >
177+ <id >github </id >
178+ <url >https://maven.pkg.github.com/EndeeLabs/endee-java-client </url >
179179 </snapshotRepository >
180180 <repository >
181181 <id >central</id >
You can’t perform that action at this time.
0 commit comments