-
Notifications
You must be signed in to change notification settings - Fork 44
143 lines (142 loc) · 6.24 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
# 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: [ '17' ]
fail-fast: false
steps:
# ____ _ __ __ ___ ____ __
# / __ ) __ __ (_)/ /____/ / ( _ ) / __ \ ____ _ _____ / /__ ____ _ ____ _ ___
# / __ |/ / / // // // __ / / __ \/| / /_/ // __ `// ___// //_// __ `// __ `// _ \
# / /_/ // /_/ // // // /_/ / / /_/ < / ____// /_/ // /__ / ,< / /_/ // /_/ // __/
# /_____/ \__,_//_//_/ \__,_/ \____/\/ /_/ \__,_/ \___//_/|_| \__,_/ \__, / \___/
# /____/
- name: Git checkout
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Cache Gradle
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-v2-
- name: Build with Gradle
run: ./gradlew jpackage
# For debugging purposes...
- name: List releases
run: ls releases
# _ __ _ __
# | | / /(_)____ ____/ /____ _ __ _____
# | | /| / // // __ \ / __ // __ \| | /| / // ___/
# | |/ |/ // // / / // /_/ // /_/ /| |/ |/ /(__ )
# |__/|__//_//_/ /_/ \__,_/ \____/ |__/|__//____/
#
- name: Rename windows release
if: matrix.os == 'windows-latest'
run: mv releases/TokenTool-*.exe releases/TokenTool-${{ github.event.release.tag_name }}.exe
- 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/TokenTool-${{ github.event.release.tag_name }}.exe
asset_name: TokenTool-${{ 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/TokenTool-${{ github.event.release.tag_name }}.msi
asset_name: TokenTool-${{ github.event.release.tag_name }}.msi
asset_content_type: application/octet-stream
# __ _
# / / (_)____ __ __ _ __
# / / / // __ \ / / / /| |/_/
# / /___ / // / / // /_/ /_> <
# /_____//_//_/ /_/ \__,_//_/|_|
#
- name: Rename Linux release
if: matrix.os == 'ubuntu-latest'
run: |
mv releases/tokentool-*-1.x86_64.rpm releases/tokentool-${{ github.event.release.tag_name }}_x86_64.rpm
mv releases/tokentool_*-1_amd64.deb releases/tokentool_${{ github.event.release.tag_name }}_amd64.deb
- 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/tokentool-${{ github.event.release.tag_name }}_x86_64.rpm
asset_name: tokentool-${{ 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/tokentool_${{ github.event.release.tag_name }}_amd64.deb
asset_name: tokentool_${{ github.event.release.tag_name }}_amd64.deb
asset_content_type: application/octet-stream
# ____ _____
# ____ ___ ____ _ _____ / __ \/ ___/
# / __ `__ \ / __ `// ___// / / /\__ \
# / / / / / // /_/ // /__ / /_/ /___/ /
# /_/ /_/ /_/ \__,_/ \___/ \____//____/
#
- name: Rename Mac release
if: matrix.os == 'macOS-latest'
run: |
mv releases/TokenTool-*.dmg releases/TokenTool-${{ github.event.release.tag_name }}.dmg
mv releases/TokenTool-*.pkg releases/TokenTool-${{ github.event.release.tag_name }}.pkg
- 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/TokenTool-${{ github.event.release.tag_name }}.dmg
asset_name: TokenTool-${{ 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/TokenTool-${{ github.event.release.tag_name }}.pkg
asset_name: TokenTool-${{ github.event.release.tag_name }}.pkg
asset_content_type: application/octet-stream