-
Notifications
You must be signed in to change notification settings - Fork 62
112 lines (92 loc) · 3.74 KB
/
include-deploy-release.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
102
103
104
105
106
107
108
109
110
111
112
name: Deploy release
on:
workflow_call:
inputs:
version-label:
required: true
type: string
packages-sha-label:
required: true
type: string
jobs:
deploy:
runs-on: macos-12
name: Deploy release
steps:
- name: git checkout
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Setup Java 11
uses: actions/setup-java@v4
with:
distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }}
java-version: ${{ vars.VERSION_JAVA }}
- name: Setup Gradle and task/dependency caching
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{ vars.VERSION_CMAKE }}
- name: Setup ninja
uses: clementetb/setup-ninja@master
with:
version: ${{ vars.VERSION_NINJA }}
- name: Install ccache
uses: hendrikmuhs/ccache-action@v1.2.13
with:
key: 'jvm-package'
max-size: '2.0G'
- name: Install coreutils and s3cmd
run: brew install coreutils s3cmd
- name: Prepend ccache executables to the PATH
run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
# See https://github.com/hendrikmuhs/ccache-action/issues/94
- name: Configure ccache
run: |
ccache --set-config="compiler_check=content"
ccache --show-config
echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang
echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++
# TODO This matches 23.2.8568313, but what happens if we define specific ndk version in our build?
- name: Setup NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: r23c
# We cannot use artifacts as they cannot be shared between workflows, so use cache instead.
- name: Setup build cache
uses: actions/cache@v4
with:
path: ./packages/build/m2-buildrepo
key: packages-m2-jvm-sync-${{ inputs.packages-sha-label }}
- name: Restore Linux JNI lib
uses: actions/download-artifact@v4
with:
name: jni-linux-lib-${{ inputs.version-label }}
path: ./packages/cinterop/build/realmLinuxBuild
- name: Restore Windows JNI lib
uses: actions/download-artifact@v4
with:
name: jni-windows-lib-${{ inputs.version-label }}
path: ./packages/cinterop/build/realmWindowsBuild/Release
- name: Restore MacOS JNI lib
uses: actions/download-artifact@v4
with:
name: jni-macos-lib-${{ inputs.version-label }}
path: ./packages/cinterop/build/realmMacOsBuild
- name: Restore m2-buildrepo
uses: actions/download-artifact@v4
with:
name: all-packages-${{ inputs.version-label }}
path: ./packages/build/m2-buildrepo
- name: Publish release to Maven Central
run: |
set +x
sh ./tools/publish_release.sh "${{ secrets.MAVEN_CENTRAL_USER_TOKEN }}" "${{ secrets.MAVEN_CENTRAL_USER_TOKEN_PASSWORD }}" \
"${{ secrets.AWS_S3_ACCESS_KEY_ID }}" "${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}" \
"${{ secrets.DOCS_S3_ACCESS_KEY }}" "${{ secrets.DOCS_S3_SECRET_KEY }}" \
"${{ secrets.SLACK_URL_RELEASE }}" "${{ secrets.SLACK_URL_CI }}" \
"${{ secrets.GRADLE_PORTAL_KEY }}" "${{ secrets.GRADLE_PORTAL_SECRET }}" \
'-PsignBuild=true -PsignSecretRingFileKotlin="${{ secrets.GPG_SIGNING_KEY_BASE_64_DBG }}" -PsignPasswordKotlin=${{ secrets.GPG_PASS_PHRASE_DBG }} -Prealm.kotlin.copyNativeJvmLibs=linux,windows'