-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (57 loc) · 1.81 KB
/
build-and-release-package.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
name: build-and-release-package
on:
workflow_dispatch:
concurrency: build-${{github.ref}}
jobs:
build-lib-for-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install requirements
run: brew install cmake gcc java11 maven
- name: Build native library for MacOS
id: build
uses: ./.github/actions/native-lib-build
- uses: actions/upload-artifact@main
with:
name: libclp-ffi-java-macos
path: ${{github.workspace}}/clp-ffi-*-native-lib/
if-no-files-found: error
build-package:
needs: build-lib-for-macos
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
server-id: 'maven'
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Install requirements
run: |
sudo apt update
sudo apt install -y build-essential cmake
- name: Build native library for Linux
id: build
uses: ./.github/actions/native-lib-build
- uses: actions/download-artifact@v3
with:
name: libclp-ffi-java-macos
path: ./target/.
- name: Build package, run tests, and deploy to GitHub
run: mvn --batch-mode deploy -Pmaven_release
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}