forked from HumbleUI/JWM
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (118 loc) · 3.72 KB
/
Copy pathbuild-deploy.yml
File metadata and controls
124 lines (118 loc) · 3.72 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
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@v4
- run: bash -c 'source /etc/profile && python3 script/build.py --only native'
- uses: actions/upload-artifact@v4
with:
name: native-linux
path: linux/build/libjwm_x64.so
build_linux_arm64:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
- run: |
sudo apt update
sudo apt install -y mesa-common-dev libgl1-mesa-dev libx11-dev libxcursor-dev libxi-dev libxrandr-dev
- run: python3 script/build.py --only native
- uses: actions/upload-artifact@v7
with:
name: native-linux-arm64
path: linux/build/libjwm_arm64.so
build_windows:
strategy:
matrix:
os: [ windows-2022, windows-11-arm ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- run: |
ninja --version
$os_arch = "${{ runner.arch }}".ToLower()
echo "os_arch=$os_arch" >> $env:GITHUB_ENV
- uses: actions/setup-java@v5
with:
distribution: 'microsoft'
java-version: '21'
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ env.os_arch }}
- run: python3 script/build.py --only native
- uses: actions/upload-artifact@v7
with:
name: native-windows-${{ env.os_arch }}
path: windows/build/jwm_${{ env.os_arch }}.dll
build_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- run: |
echo "JAVA_HOME=$JAVA_HOME_21_arm64" >> $GITHUB_ENV
echo "$JAVA_HOME_21_arm64/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@v4
with:
name: native-macos
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@v4
- run: |
echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV
echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH
- run: python3 script/build.py --only java
- uses: actions/download-artifact@v4
with:
pattern: native-*
path: target/classes
merge-multiple: true
- run: python3 script/package.py --only java --ref ${{ github.ref }}
- uses: actions/upload-artifact@v4
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
python3 script/release.py --only java --ref ${{ github.ref }}
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
SONATYPE_BEARER_TOKEN: ${{ secrets.SONATYPE_BEARER_TOKEN }}
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@v2
with:
body_path: RELEASE_NOTES.md
files: |
target/*.jar