forked from g3force/jinput
-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (130 loc) · 5.36 KB
/
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
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
name: JInput Release
on: [workflow_dispatch]
jobs:
release-build-natives:
name: ${{ matrix.name }} natives build
if: github.ref == 'refs/heads/master'
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
release:
needs: release-build-natives
name: Release
environment: OSSRH
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure Git User
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Setup JDK
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: 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: Set Release Version
run: mvn --batch-mode --file pom.xml --also-make --activate-profiles windows,linux,osx,wintab --projects plugins/awt,uberjar,tests,examples versions:set -DremoveSnapshot
- name: Set environment
run: echo "RELEASE_VERSION=$(mvn -Dexpression=project.version help:evaluate | grep -e '^[[:digit:]]')" >> $GITHUB_ENV
- name: Update docs
run: |
sed -i "/^jinput_version.*/c\jinput_version: $RELEASE_VERSION" docs/_config.yml
- name: Commit docs change
run: git commit -m "Update docs for release $RELEASE_VERSION" docs/_config.yml
- name: Tag release
run: git tag -a $RELEASE_VERSION -m "Release tag $RELEASE_VERSION"
- name: Release
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,release --projects plugins/awt,uberjar,tests,examples -Dmaven.antrun.skip -Dmaven.test.skip -DskipTests -DskipITs deploy
- name: Reset version
run: mvn --batch-mode --file pom.xml --also-make --activate-profiles windows,linux,osx,wintab --projects plugins/awt,uberjar,tests,examples versions:revert
- name: Set next development version
run: mvn --batch-mode --file pom.xml --also-make --activate-profiles windows,linux,osx,wintab --projects plugins/awt,uberjar,tests,examples versions:set -DnextSnapshot
- name: Commit next dev versions
run: git commit -m 'Next development release' .
- name: Git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push origin HEAD:master --follow-tags