-
Notifications
You must be signed in to change notification settings - Fork 46
95 lines (90 loc) · 2.84 KB
/
build-deploy.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
name: Build and publish
on:
push:
branches:
- '**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
paths-ignore:
- .gitignore
- 'docs/**'
- 'examples/**'
- 'extras/**'
- CHANGELOG.md
- LICENSE
- README.md
pull_request:
jobs:
build_linux:
runs-on: ubuntu-latest
container: tonsky/jwm:latest
steps:
- uses: actions/checkout@v3
- run: bash -c 'source /etc/profile && python3 script/build.py --only native'
- uses: actions/upload-artifact@v3
with:
name: native
path: linux/build/libjwm_x64.so
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: abdes/gha-setup-ninja@660f330a40aefa8d11632b3f901e92a4adb33d65
- run: |
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "$JAVA_HOME_11_X64/bin" >> $GITHUB_PATH
shell: bash
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- run: python3 script/build.py --only native
- uses: actions/upload-artifact@v3
with:
name: native
path: windows/build/jwm_x64.dll
build_macos:
runs-on: macos-11
steps:
- uses: actions/checkout@v3
- uses: abdes/gha-setup-ninja@660f330a40aefa8d11632b3f901e92a4adb33d65
- run: |
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "$JAVA_HOME_11_X64/bin" >> $GITHUB_PATH
- run: python3 script/build.py --arch=x64 --only native
- run: python3 script/build.py --arch=arm64 --only native
- uses: actions/upload-artifact@v3
with:
name: native
path: |
macos/build/libjwm_x64.dylib
macos/build/libjwm_arm64.dylib
deploy:
runs-on: ubuntu-latest
needs: [build_linux, build_windows, build_macos]
steps:
- uses: actions/checkout@v3
- run: |
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "$JAVA_HOME_11_X64/bin" >> $GITHUB_PATH
- run: python3 script/build.py --only java
- uses: actions/download-artifact@v3
with:
name: native
path: target/classes
- run: python3 script/package.py --only java --ref ${{ github.ref }}
- uses: actions/upload-artifact@v3
with:
name: jars
path: |
target/*.jar
target/maven/META-INF/maven/io.github.humbleui/jwm/pom.xml
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
name: Deploy to Maven Central
run: |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
gpg --list-keys
python3 script/release.py --only java --ref ${{ github.ref }}
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}