Skip to content

Commit f2b68a3

Browse files
committed
feat: Prepare for first publish
1 parent 1287c10 commit f2b68a3

File tree

5 files changed

+86
-5
lines changed

5 files changed

+86
-5
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Build
33
on:
44
push:
55
pull_request:
6-
workflow_call:
76

87
jobs:
98
build:
@@ -30,8 +29,6 @@ jobs:
3029
distribution: 'graalvm'
3130
- name: Setup Gradle
3231
uses: gradle/actions/setup-gradle@v5
33-
with:
34-
cache-read-only: ${{ github.event_name != 'push' }}
3532
- name: Build with Gradle
3633
run: ./gradlew build
3734
- name: Javadoc with Gradle

.github/workflows/publish.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
13+
env:
14+
ZSTD_VERSION: v1.5.7
15+
steps:
16+
- uses: actions/checkout@v5
17+
- name: Install zstd from source
18+
run: |
19+
git clone --branch "$ZSTD_VERSION" --depth 1 https://github.com/facebook/zstd.git zstd
20+
cd zstd
21+
make -j$(nproc)
22+
sudo make PREFIX=/usr install
23+
sudo ldconfig
24+
cd ..
25+
- name: Set up JDK 25
26+
uses: actions/setup-java@v5
27+
with:
28+
java-version: '25'
29+
distribution: 'graalvm'
30+
- name: Setup Gradle
31+
uses: gradle/actions/setup-gradle@v5
32+
- name: Build with Gradle
33+
run: ./gradlew build
34+
- name: Javadoc with Gradle
35+
run: ./gradlew javadoc
36+
- name: Test with Gradle
37+
run: ./gradlew test
38+
- name: Native tests with Gradle
39+
run: ./gradlew nativeTest
40+
- name: Export TAG_VERSION
41+
run: echo "TAG_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
42+
- name: Publish to Maven Central
43+
run: ./gradlew publish
44+
env:
45+
ORG_GRADLE_PROJECT_version: ${{ env.TAG_VERSION }}
46+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.CENTRAL_USERNAME }}
47+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.CENTRAL_PASSWORD }}
48+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.CENTRAL_SIGNINGKEY }}
49+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.CENTRAL_SIGNINGKEY_PASSWORD }}

ROADMAP.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ Support bindings separately to allow implementations that just consume the jextr
1515

1616
1.0 Will not be tagged until all TODOS are addressed, and Streaming no longer can do out of bound accesses
1717

18-
Consider splitting API into dev.hallock.zstd.api to use services pro
18+
Consider splitting API into dev.hallock.zstd.api to use services pro
19+
20+
Unify GitHub common workflow actions steps

build.gradle.kts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
`java-library`
33
alias(libs.plugins.graalvm.buildtools)
4+
alias(libs.plugins.maven.publish)
45
}
56

67
group = "dev.hallock.zstd"
@@ -60,3 +61,33 @@ graalvmNative {
6061
}
6162
}
6263

64+
mavenPublishing {
65+
publishToMavenCentral(automaticRelease = false)
66+
signAllPublications()
67+
68+
pom {
69+
name.set("zstd-java")
70+
description.set("Java (FFM) API for Zstandard (zstd)")
71+
inceptionYear.set("2026")
72+
url.set("https://github.com/ryanhallock/zstd-java/")
73+
licenses {
74+
license {
75+
name.set("The Apache License, Version 2.0")
76+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
77+
distribution.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
78+
}
79+
}
80+
developers {
81+
developer {
82+
id.set("ryanhallock")
83+
name.set("Ryan Hallock")
84+
url.set("https://github.com/ryanhallock/")
85+
}
86+
}
87+
scm {
88+
url.set("https://github.com/ryanhallock/zstd-java/")
89+
connection.set("scm:git:git://github.com/ryanhallock/zstd-java.git")
90+
developerConnection.set("scm:git:ssh://git@github.com/ryanhallock/zstd-java.git")
91+
}
92+
}
93+
}

gradle/libs.versions.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ graalvm-buildtools = "0.11.5"
33
jspecify = "1.0.0"
44
junit = "6.0.3"
55
jextract = "1.4.0"
6+
maven-publish = "0.36.0"
67

78
[libraries]
89
jspecify = { group = "org.jspecify", name = "jspecify", version.ref = "jspecify" }
@@ -13,4 +14,5 @@ junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher
1314

1415
[plugins]
1516
graalvm-buildtools = { id = "org.graalvm.buildtools.native", version.ref = "graalvm-buildtools" }
16-
jextract = { id = "de.infolektuell.jextract", version.ref = "jextract"}
17+
jextract = { id = "de.infolektuell.jextract", version.ref = "jextract"}
18+
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }

0 commit comments

Comments
 (0)