forked from RPTools/maptool
-
Notifications
You must be signed in to change notification settings - Fork 0
189 lines (188 loc) · 8.13 KB
/
publish.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
179
180
181
182
183
184
185
186
187
188
189
# Builds and uploads native install packages for Windows, Linux & macOS
# Create and Publish a GitHub Release to activate this workflow.
# Tag will be used for version and must follow semver x.x.x format exactly or jpackage will fail
# Only digits allowed and must include major.minor.patch numbers.
name: Publish Assets
on:
release:
types:
- published
jobs:
build:
name: ${{ matrix.os }} w/JDK ${{ matrix.java }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macOS-latest]
java: [ '21' ]
distribution: ['temurin']
fail-fast: false
steps:
# ____ _ __ __ ___ ____ __
# / __ ) __ __ (_)/ /____/ / ( _ ) / __ \ ____ _ _____ / /__ ____ _ ____ _ ___
# / __ |/ / / // // // __ / / __ \/| / /_/ // __ `// ___// //_// __ `// __ `// _ \
# / /_/ // /_/ // // // /_/ / / /_/ < / ____// /_/ // /__ / ,< / /_/ // /_/ // __/
# /_____/ \__,_//_//_/ \__,_/ \____/\/ /_/ \__,_/ \___//_/|_| \__,_/ \__, / \___/
# /____/
- name: Git checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Cache Gradle
uses: actions/cache@v3
# Cache only seems to work on ubuntu right now...
if: matrix.os == 'ubuntu-latest'
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
run: ./gradlew jpackage
- name: Copy the RPM to the location required to build the ArchLinux package
if: matrix.os == 'ubuntu-latest'
run: cp releases/maptool-*.rpm package/archlinux/maptool/maptool.rpm
continue-on-error: true
- name: Build ArchLinux package
uses: 2m/[email protected]
# This only even makes sense on Ubuntu.
if: matrix.os == 'ubuntu-latest'
env:
MAPTOOL_VERSION: ${{ github.event.release.tag_name }}
with:
target: 'pkgbuild'
pkgname: 'package/archlinux/maptool'
- name: Build uberJar on Windows
if: matrix.os == 'windows-latest'
run: ./gradlew shadowJar
# For debugging purposes...
- name: List releases
run: ls releases
# _ __ _ __
# | | / /(_)____ ____/ /____ _ __ _____
# | | /| / // // __ \ / __ // __ \| | /| / // ___/
# | |/ |/ // // / / // /_/ // /_/ /| |/ |/ /(__ )
# |__/|__//_//_/ /_/ \__,_/ \____/ |__/|__//____/
#
- name: Copy Windows Release Files
if: matrix.os == 'windows-latest'
run: |
cp releases/MapTool*.exe releases/MapTool-${{ github.event.release.tag_name }}.exe
cp releases/MapTool*.msi releases/MapTool-${{ github.event.release.tag_name }}.msi
continue-on-error: true
- name: Upload Windows EXE Release Asset
id: upload-release-asset-exe
uses: actions/upload-release-asset@v1
if: matrix.os == 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: releases/MapTool-${{ github.event.release.tag_name }}.exe
asset_name: MapTool-${{ github.event.release.tag_name }}.exe
asset_content_type: application/octet-stream
- name: Upload Windows MSI Release Asset
id: upload-release-asset-msi
uses: actions/upload-release-asset@v1
if: matrix.os == 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: releases/MapTool-${{ github.event.release.tag_name }}.msi
asset_name: MapTool-${{ github.event.release.tag_name }}.msi
asset_content_type: application/octet-stream
- name: Upload Uber Jar Release Asset
id: upload-release-asset-jar
uses: actions/upload-release-asset@v1
if: matrix.os == 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: releases/MapTool-${{ github.event.release.tag_name }}.jar
asset_name: MapTool-${{ github.event.release.tag_name }}.jar
asset_content_type: application/octet-stream
# __ _
# / / (_)____ __ __ _ __
# / / / // __ \ / / / /| |/_/
# / /___ / // / / // /_/ /_> <
# /_____//_//_/ /_/ \__,_//_/|_|
#
- name: Copy Linux Release Files
if: matrix.os == 'ubuntu-latest'
run: |
cp releases/maptool*.x86_64.rpm releases/maptool-${{ github.event.release.tag_name }}.x86_64.rpm
cp releases/maptool*_amd64.deb releases/maptool_${{ github.event.release.tag_name }}_amd64.deb
cp package/archlinux/maptool/maptool-*-x86_64.pkg.tar.zst releases/maptool-${{ github.event.release.tag_name }}-x86_64.pkg.tar.zst
continue-on-error: true
- name: Upload Linux RPM Release Asset
id: upload-release-asset-rpm
uses: actions/upload-release-asset@v1
if: matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: releases/maptool-${{ github.event.release.tag_name }}.x86_64.rpm
asset_name: maptool-${{ github.event.release.tag_name }}-x86_64.rpm
asset_content_type: application/octet-stream
- name: Upload Linux DEB Release Asset
id: upload-release-asset-deb
uses: actions/upload-release-asset@v1
if: matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: releases/maptool_${{ github.event.release.tag_name }}_amd64.deb
asset_name: maptool_${{ github.event.release.tag_name }}-amd64.deb
asset_content_type: application/octet-stream
- name: Upload ArchLinux Release Asset
id: upload-release-asset-arch
uses: actions/upload-release-asset@v1
if: matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: releases/maptool-${{ github.event.release.tag_name }}-x86_64.pkg.tar.zst
asset_name: maptool-${{ github.event.release.tag_name }}-x86_64.pkg.tar.zst
asset_content_type: application/octet-stream
# ____ _____
# ____ ___ ____ _ _____ / __ \/ ___/
# / __ `__ \ / __ `// ___// / / /\__ \
# / / / / / // /_/ // /__ / /_/ /___/ /
# /_/ /_/ /_/ \__,_/ \___/ \____//____/
#
- name: Copy Mac OS Release Files
if: matrix.os == 'macOS-latest'
run: |
cp releases/MapTool*.dmg releases/MapTool-${{ github.event.release.tag_name }}.dmg
cp releases/MapTool*.pkg releases/MapTool-${{ github.event.release.tag_name }}.pkg
continue-on-error: true
- name: Upload Mac DMG Release Asset
id: upload-release-asset-dmg
uses: actions/upload-release-asset@v1
if: matrix.os == 'macOS-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: releases/MapTool-${{ github.event.release.tag_name }}.dmg
asset_name: MapTool-${{ github.event.release.tag_name }}.dmg
asset_content_type: application/octet-stream
- name: Upload Mac PKG Release Asset
id: upload-release-asset-pkg
uses: actions/upload-release-asset@v1
if: matrix.os == 'macOS-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: releases/MapTool-${{ github.event.release.tag_name }}.pkg
asset_name: MapTool-${{ github.event.release.tag_name }}.pkg
asset_content_type: application/octet-stream