-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (72 loc) · 2.75 KB
/
release-java-bindings.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Publish Java bindings
on:
workflow_dispatch:
inputs:
ref:
description: The reference (branch/tag/commit) to checkout
required: true
jobs:
publish:
name: Publish Java bindings
runs-on: macos-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: master
- name: Install Rust
uses: dtolnay/[email protected]
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY_JAVA_PUBLISHING }}
passphrase: ${{ secrets.GPG_PASSPHRASE_JAVA_PUBLISHING }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Homebrew
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: Install mingw-w64 for Windows cross-compilation
run: |
brew install mingw-w64
- name: Install linker for x86_64-unknown-linux-gnu
run: |
brew install SergioBenitez/osxct/x86_64-unknown-linux-gnu
- name: Install linker for aarch64-unknown-linux-gnu
run: |
brew tap messense/homebrew-macos-cross-toolchains
brew install aarch64-unknown-linux-gnu
- name: Rename cross.toml file so cargo uses the correct linkers
run: |
mv .cargo/config.cross.toml .cargo/config.toml
- name: Run compile script
run: |
chmod +x scripts/compile_all_targets_java.sh
scripts/compile_all_targets_java.sh
- name: Publish Java package to Maven Central
env:
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.CENTRAL_PORTAL_TOKEN_USERNAME }}
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.CENTRAL_PORTAL_TOKEN_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE_JAVA_PUBLISHING }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY_JAVA_PUBLISHING }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY_JAVA_PUBLISHING }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew clean createJReleaserOutputDir jreleaserConfig build publish jreleaserFullRelease --stacktrace --info
- name: JReleaser output
if: always()
uses: actions/upload-artifact@v4
with:
name: jreleaser-logs
path: |
build/jreleaser/trace.log
build/jreleaser/output.properties