Skip to content

Commit 72d1969

Browse files
committed
chore: add develop publishing to github
1 parent 8067637 commit 72d1969

2 files changed

Lines changed: 23 additions & 10 deletions

File tree

.github/workflows/snapshot.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
name: Dev Build
1+
name: Publish Snapshot to GitHub Packages
22

33
on:
44
push:
55
branches:
66
- dev
77

88
jobs:
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 }}

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@
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>

0 commit comments

Comments
 (0)