Skip to content

Commit 99f48fb

Browse files
committed
Set up CI publishing
1 parent e994831 commit 99f48fb

File tree

1 file changed

+55
-1
lines changed

1 file changed

+55
-1
lines changed
Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ on:
55
workflow_dispatch:
66

77
env:
8-
COMMON_CMAKE_FLAGS: "-DZSTD_BUILD_PROGRAMS=OFF -DZSTD_LEGACY_SUPPORT=OFF -DZSTD_BUILD_STATIC=OFF -DBUILD_SHARED_LIBS=ON -DZSTD_BUILD_DICTBUILDER=OFF -DZSTD_BUILD_COMPRESSION=OFF"
8+
COMMON_CMAKE_FLAGS: "-DZSTD_BUILD_PROGRAMS=OFF -DZSTD_LEGACY_SUPPORT=OFF -DZSTD_BUILD_STATIC=OFF -DBUILD_SHARED_LIBS=ON -DZSTD_BUILD_DICTBUILDER=OFF -DZSTD_BUILD_COMPRESSION=OFF -DCMAKE_BUILD_TYPE=Release"
9+
10+
concurrency:
11+
group: "publish"
912

1013
jobs:
1114
build:
@@ -72,3 +75,54 @@ jobs:
7275
with:
7376
name: zstd-${{ matrix.os }}
7477
path: output
78+
79+
publish:
80+
runs-on: ubuntu-latest
81+
needs: [build]
82+
steps:
83+
- name: Clone repo
84+
uses: actions/checkout@v5
85+
86+
- name: Set up JDK 25
87+
uses: actions/setup-java@v5
88+
with:
89+
distribution: temurin
90+
java-version: 25
91+
92+
- name: Setup Gradle
93+
uses: gradle/actions/setup-gradle@v5
94+
with:
95+
cache-disabled: true
96+
97+
- name: Download Artifacts
98+
uses: actions/download-artifact@v5
99+
with:
100+
path: temp
101+
pattern: zstd-*
102+
merge-multiple: true
103+
104+
- name: Move Artifacts
105+
run: |
106+
mkdir -p natives/src/main/resources/natives/linux-x86-64
107+
mkdir -p natives/src/main/resources/natives/linux-aarch64
108+
mkdir -p natives/src/main/resources/natives/linux-arm
109+
mkdir -p natives/src/main/resources/natives/win32-x86-64
110+
mkdir -p natives/src/main/resources/natives/win32-aarch64
111+
mkdir -p natives/src/main/resources/natives/darwin
112+
cp temp/x64/libzstd.so natives/src/main/resources/natives/linux-x86-64/libzstd.so
113+
cp temp/ARM64/libzstd.so natives/src/main/resources/natives/linux-aarch64/libzstd.so
114+
cp temp/ARM/libzstd.so natives/src/main/resources/natives/linux-arm/libzstd.so
115+
cp temp/x64/libzstd.dll natives/src/main/resources/natives/win32-x86-64/libzstd.dll
116+
cp temp/ARM64/libzstd.dll natives/src/main/resources/natives/win32-aarch64/libzstd.dll
117+
cp temp/libzstd.dylib natives/src/main/resources/natives/darwin/libzstd.dylib
118+
119+
- name: Publish to Maven Central
120+
env:
121+
TEST_DATA_ZSTD_KEY: ${{ secrets.TEST_DATA_ZSTD_KEY }}
122+
TEST_DATA_ZSTD_PARAMETERS: ${{ secrets.TEST_DATA_ZSTD_PARAMETERS }}
123+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
124+
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.MAVENCENTRAL_TOKEN }}
125+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
126+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
127+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
128+
run: ./gradlew build publish jreleaserDeploy

0 commit comments

Comments
 (0)