Skip to content

Commit f1b362f

Browse files
Merge pull request #13 from sk-ai-net/feature/publish-github
Feature/publish GitHub
2 parents 5e4f377 + 41ce9b6 commit f1b362f

2 files changed

Lines changed: 54 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish to GitHub Packages
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
build-job:
7+
runs-on: ubuntu-latest # enables hardware acceleration in the virtual machine
8+
timeout-minutes: 30
9+
10+
permissions:
11+
contents: write
12+
packages: write
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Copy CI gradle.properties
19+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
20+
21+
- name: Set up JDK 21
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: 'zulu'
25+
java-version: 17
26+
27+
28+
- name: Print git commit variables
29+
run: |
30+
echo "TAG: $CURRENT_TAG"
31+
32+
- name: Copy CI gradle.properties
33+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
34+
35+
- name: Build
36+
run: ./gradlew --stacktrace clean assemble
37+
38+
- name: Setup Gradle
39+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
40+
41+
- name: Publish package
42+
run: ./gradlew publish
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

convention-plugins/src/main/kotlin/module.publication.gradle.kts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ plugins {
88
}
99

1010
publishing {
11+
repositories {
12+
maven {
13+
name = "GitHubPackages"
14+
url = uri("https://maven.pkg.github.com/sk-ai-net/skainet")
15+
credentials {
16+
username = System.getenv("GITHUB_ACTOR")
17+
password = System.getenv("GITHUB_TOKEN")
18+
}
19+
}
20+
}
1121
// Configure all publications
1222
publications.withType<MavenPublication> {
1323
// Stub javadoc.jar artifact
@@ -19,7 +29,6 @@ publishing {
1929
// Provide artifacts information required by Maven Central
2030
pom {
2131
name.set("skainet - Kotlin Multiplatform library")
22-
2332
licenses {
2433
license {
2534
name.set("MIT")

0 commit comments

Comments
 (0)