Skip to content

Commit 1f5fb86

Browse files
authored
Merge pull request #62 from sourceplusplus/use-gh-packages
use gh packages test
2 parents 801fcf7 + 0241407 commit 1f5fb86

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,21 @@ jobs:
6060
tag_name: ${{ env.SPP_PROTOCOL_VERSION }}
6161
release_name: v${{ env.SPP_PROTOCOL_VERSION }}
6262
draft: true
63+
64+
- name: Remove Old Snapshot Packages
65+
if: github.ref == 'refs/heads/master'
66+
uses: smartsquaregmbh/delete-old-packages@v0.4.0
67+
with:
68+
keep: 0
69+
version-pattern: "^\\d+\\.\\d+\\.\\d+-SNAPSHOT$"
70+
names: |
71+
spp.protocol.protocol
72+
spp.protocol.protocol-jvm
73+
spp.protocol.protocol-js
74+
75+
- name: Publish New Snapshot Packages
76+
if: github.ref == 'refs/heads/master'
77+
run: ./gradlew publish
78+
env:
79+
GH_PUBLISH_USERNAME: $GITHUB_ACTOR
80+
GH_PUBLISH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.gradle.kts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ repositories {
2222

2323
configure<PublishingExtension> {
2424
repositories {
25-
maven("file://${System.getenv("HOME")}/.m2/repository")
25+
maven {
26+
name = "GitHubPackages"
27+
url = uri("https://maven.pkg.github.com/sourceplusplus/protocol")
28+
credentials {
29+
username = System.getenv("GH_PUBLISH_USERNAME")?.toString()
30+
password = System.getenv("GH_PUBLISH_TOKEN")?.toString()
31+
}
32+
}
2633
}
2734
}
2835

0 commit comments

Comments
 (0)