-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (132 loc) · 5.15 KB
/
Copy pathbinaries.yml
File metadata and controls
135 lines (132 loc) · 5.15 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
125
126
127
128
129
130
131
132
133
134
135
name: Release
on:
push:
branches: [ main ]
paths-ignore:
- 'docs/**'
- 'src/test/**'
- 'README.md'
tags:
- '*'
pull_request:
types: [opened, synchronize, reopened, labeled]
workflow_dispatch:
inputs:
jvmDistribution:
# No 'default:' - the dropdown pre-selects the first option (temurin),
# and push/PR fall back to env.JVM_DISTRIBUTION, so the default value is
# defined only once (in env). List from setup-java supported distributions.
description: 'JDK distribution (setup-java)'
type: choice
options:
- temurin
- adopt
- adopt-openj9
- corretto
- dragonwell
- graalvm
- jetbrains
- liberica
- microsoft
- oracle
- sapmachine
- semeru
- zulu
javaVersion:
description: 'JDK version - blank uses the default'
type: string
required: false
buildInstaller:
description: "Build native installer + portable zip (jpackage)"
type: boolean
required: false
default: false
upload-as-release-draft:
description: "Upload as release draft"
type: boolean
required: false
default: false
# Single source of truth for the JDK defaults, used on push/PR (where inputs are
# empty) and as the fallback for a blank workflow_dispatch input.
env:
JVM_DISTRIBUTION: temurin
JAVA_VERSION: '25'
jobs:
package:
strategy:
fail-fast: false
matrix:
include:
# archivePortable: zip the jpackage app-image (portable, no-install)
# then delete the dir so only the installer + zip remain (JabRef pattern).
- os: windows-latest
platform: windows
displayName: Windows
appImage: MinDis
archivePortable: 7z a -r mindis-gui/build/packages/windows/MinDis-portable-windows.zip ./mindis-gui/build/packages/windows/MinDis && rm -r mindis-gui/build/packages/windows/MinDis
- os: ubuntu-latest
platform: linux
displayName: Linux
appImage: MinDis
archivePortable: cd mindis-gui/build/packages/linux && zip -r MinDis-portable-linux.zip MinDis && rm -r MinDis
- os: macos-latest
platform: macos
displayName: macOS
appImage: MinDis.app
archivePortable: cd mindis-gui/build/packages/macos && ditto -c -k --keepParent MinDis.app MinDis-portable-macos.zip && rm -r MinDis.app
name: ${{ matrix.displayName }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup JDK ${{ inputs.jvmDistribution || env.JVM_DISTRIBUTION }}-${{ inputs.javaVersion || env.JAVA_VERSION }}
uses: actions/setup-java@v5
with:
distribution: ${{ inputs.jvmDistribution || env.JVM_DISTRIBUTION }}
java-version: ${{ inputs.javaVersion || env.JAVA_VERSION }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Build
run: ./gradlew build
- name: Install WiX
if: runner.os == 'Windows' && github.event.inputs.buildInstaller == 'true'
shell: pwsh
run: |
dotnet tool install --global wix --version 5.0.2
$tools = "$env:USERPROFILE\.dotnet\tools"
$env:PATH = "$tools;$env:PATH"
echo "$tools" >> $env:GITHUB_PATH
wix extension add --global WixToolset.UI.wixext/5.0.2
wix extension add --global WixToolset.Util.wixext/5.0.2
- name: Build installer (jpackage)
if: github.event.inputs.buildInstaller == 'true'
run: ./gradlew :gui:jpackage
- name: Archive portable app-image (no-install zip)
if: github.event.inputs.buildInstaller == 'true'
shell: bash
run: ${{ matrix.archivePortable }}
- name: Upload installer and portable artifact
if: github.event.inputs.buildInstaller == 'true'
uses: actions/upload-artifact@v7
with:
name: MinDis-${{ matrix.platform }}-installer
# Installer, checksum and the portable zip. The app-image dir was
# zipped and removed by the archive step above.
path: mindis-gui/build/packages/${{ matrix.platform }}/*
if-no-files-found: error
- name: Attach to GitHub release
if: ${{ github.event.inputs.buildInstaller == 'true' && github.event.inputs.upload-as-release-draft == 'true' }}
uses: softprops/action-gh-release@v3
with:
files: |
mindis-gui/build/packages/${{ matrix.platform }}/*.msi
mindis-gui/build/packages/${{ matrix.platform }}/*.exe
mindis-gui/build/packages/${{ matrix.platform }}/*.deb
mindis-gui/build/packages/${{ matrix.platform }}/*.rpm
mindis-gui/build/packages/${{ matrix.platform }}/*.dmg
mindis-gui/build/packages/${{ matrix.platform }}/*.pkg
mindis-gui/build/packages/${{ matrix.platform }}/*-portable-*.zip
mindis-gui/build/packages/${{ matrix.platform }}/*.sha256
generate_release_notes: true