-
Notifications
You must be signed in to change notification settings - Fork 6
101 lines (95 loc) · 3.45 KB
/
publish-jvm.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: publish jvm packages
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
on:
push:
tags:
- "**"
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
CARGO_TERM_COLOR: always
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
jobs:
build-linux:
uses: ./.github/workflows/build-jvm-linux.yml
build-darwin-artifacts:
if: github.repository == 'wireapp/core-crypto'
name: build darwin artifacts
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1 # this implicitly caches Rust tools and build artifacts
with:
rustflags: ''
target: "x86_64-apple-darwin,aarch64-apple-darwin"
- name: setup cargo-make
uses: davidB/rust-cargo-make@v1
- name: build artifacts
run: |
cd crypto-ffi
cargo make jvm-darwin
- name: upload x86_64-apple-darwin artifacts
uses: actions/upload-artifact@v4
with:
name: x86_64-apple-darwin
path: target/x86_64-apple-darwin/release/*.dylib
- name: upload aarch64-apple-darwin artifacts
uses: actions/upload-artifact@v4
with:
name: aarch64-apple-darwin
path: target/aarch64-apple-darwin/release/*.dylib
publish-jvm:
if: github.repository == 'wireapp/core-crypto'
name: publish jvm package
needs: [build-linux, build-darwin-artifacts]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up jdk 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "adopt"
- uses: actions-rust-lang/setup-rust-toolchain@v1 # this implicitly caches Rust tools and build artifacts
with:
rustflags: ''
- name: setup cargo-make
uses: davidB/rust-cargo-make@v1
- name: build artifacts
run: |
cd crypto-ffi
cargo make ffi-kotlin-jvm
- name: gradle setup
uses: gradle/actions/setup-gradle@v4
- name: validate gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: download x86_64 linux artifact
uses: actions/download-artifact@v4
with:
name: jvm-linux-so-file-${{ github.run_id }}
path: target/x86_64-unknown-linux-gnu/release
- name: download x86_64 apple darwin artifact
uses: actions/download-artifact@v4
with:
name: x86_64-apple-darwin
path: target/x86_64-apple-darwin/release
- name: download aarch64 apple darwin artifact
uses: actions/download-artifact@v4
with:
name: aarch64-apple-darwin
path: target/aarch64-apple-darwin/release
- name: publish package
run: |
cd crypto-ffi/bindings
./gradlew :uniffi-jvm:publishAllPublicationsToMavenCentral --no-configuration-cache
./gradlew :jvm:publishAllPublicationsToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.PGP_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.PGP_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.PGP_PASSPHRASE }}