forked from jinput/jinput
-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (157 loc) · 5.64 KB
/
build.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: JInput CI
on: [push, workflow_dispatch]
jobs:
build-natives:
name: ${{ matrix.name }} natives build
strategy:
matrix:
include:
- name: Linux
os: ubuntu-latest
artifact: linux-natives
project: plugins/linux
- name: Windows
os: windows-latest
artifact: windows-natives
project: plugins/windows
- name: Wintab
os: windows-latest
artifact: wintab-natives
project: plugins/wintab
- name: macOS
os: macos-latest
artifact: macos-natives
project: plugins/OSX
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
java-package: jdk
- name: Setup MSVC Dev Cmd
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: Download and Extract Wintab SDK
if: matrix.name == 'Wintab'
run: |
mkdir wintab-sdk
cd wintab-sdk
curl -L -O https://raw.githubusercontent.com/Wacom-Developer/wacom-device-kit-windows/master/Wintab%20Tablet%20Controls/SampleCode/Wintab/WINTAB.H
curl -L -O https://raw.githubusercontent.com/Wacom-Developer/wacom-device-kit-windows/master/Wintab%20Tablet%20Controls/SampleCode/Wintab/PKTDEF.H
cd -
- name: Build with Maven
env:
WintabSdkDir: ${{ github.workspace }}/wintab-sdk
run: mvn --batch-mode --file pom.xml --also-make --projects ${{ matrix.project }} clean compile
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: |
${{ matrix.project }}/target/natives/*.so*
${{ matrix.project }}/target/natives/*.dll
${{ matrix.project }}/target/natives/*.jnilib
build:
needs: build-natives
name: Packaged build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
java-package: jdk
- name: Clean
run: mvn --batch-mode --file pom.xml --also-make --activate-profiles linux,windows,osx,wintab --projects plugins/awt,uberjar,tests,examples clean
- name: Unpack linux natives
uses: actions/download-artifact@v4
with:
name: linux-natives
path: plugins/linux/target/natives
- name: Unpack macos natives
uses: actions/download-artifact@v4
with:
name: macos-natives
path: plugins/OSX/target/natives
- name: Unpack windows natives
uses: actions/download-artifact@v4
with:
name: windows-natives
path: plugins/windows/target/natives
- name: Unpack wintab natives
uses: actions/download-artifact@v4
with:
name: wintab-natives
path: plugins/wintab/target/natives
- name: Package
run: mvn --batch-mode --file pom.xml --also-make --activate-profiles linux,windows,osx,wintab --projects plugins/awt,uberjar,tests,examples -Dmaven.antrun.skip package
- name: Upload CoreAPI Artifacts
uses: actions/upload-artifact@v4
with:
name: coreapi
path: coreAPI/target/*.jar
- name: Upload Uberjar Artifacts
uses: actions/upload-artifact@v4
with:
name: uberjar
path: uberjar/target/jinput-*.jar
deploy:
needs: build-natives
name: Deploy Snapshot
environment: OSSRH
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
java-package: jdk
- name: Clean
run: mvn --batch-mode --file pom.xml --also-make --activate-profiles linux,windows,osx,wintab --projects plugins/awt,uberjar,tests,examples clean
- name: Unpack linux natives
uses: actions/download-artifact@v4
with:
name: linux-natives
path: plugins/linux/target/natives
- name: Unpack macos natives
uses: actions/download-artifact@v4
with:
name: macos-natives
path: plugins/OSX/target/natives
- name: Unpack windows natives
uses: actions/download-artifact@v4
with:
name: windows-natives
path: plugins/windows/target/natives
- name: Unpack wintab natives
uses: actions/download-artifact@v4
with:
name: wintab-natives
path: plugins/wintab/target/natives
- name: Setup snapshot deploy
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
java-package: jdk
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Snapshot deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: mvn --batch-mode --file pom.xml --also-make --activate-profiles linux,windows,osx,wintab --projects plugins/awt,uberjar,tests,examples -Dmaven.antrun.skip -Dmaven.test.skip -DskipTests -DskipITs deploy