-
Notifications
You must be signed in to change notification settings - Fork 2
115 lines (103 loc) · 3.28 KB
/
build-release.yaml
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
# This is used to build a release for each platform - Windows, Linux, and macOS.
# Each platform has multiple installers/packages (e.g. Windows has .exe and .msi).
# To Build one gradle is used via the build{OS}{Installer} task. (e.g. buildWindowsExe)
name: Build Release
on:
push:
tags:
- 'v*.*.*'
- 'v*.*.*-pre'
permissions:
contents: write
jobs:
BuildRelease:
strategy:
matrix:
TASK: [ buildWindowsExe, buildWindowsMsi, buildLinuxDeb, buildLinuxRpm, buildMacPkg, buildMacDmg ]
include:
- TASK: buildWindowsExe
OS: Windows
INSTALLER: Exe
RUNTIME: windows-latest
- TASK: buildWindowsMsi
OS: Windows
INSTALLER: Msi
RUNTIME: windows-latest
- TASK: buildLinuxDeb
OS: Linux
INSTALLER: Deb
RUNTIME: ubuntu-latest
- TASK: buildLinuxRpm
OS: Linux
INSTALLER: Rpm
RUNTIME: ubuntu-latest
- TASK: buildMacPkg
OS: MacOs
INSTALLER: Pkg
RUNTIME: macos-latest
- TASK: buildMacDmg
OS: MacOs
INSTALLER: Dmg
RUNTIME: macos-latest
runs-on: ${{ matrix.RUNTIME }}
name: Build ${{ matrix.INSTALLER }} for ${{ matrix.OS }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'liberica'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Release
run: ./gradlew ${{ matrix.TASK }} --info
- name: List files
run: ls -R ${{ github.workspace }}/build/installer
- name: Upload Release
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.OS }}-${{ matrix.INSTALLER }}
path: ${{ github.workspace }}/build/installer/*
if-no-files-found: error
retention-days: 14
BuildReleaseJar:
name: Build release Jar
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'liberica'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Release Jar
run: ./gradlew buildReleaseJar
- name: List files
run: ls -R ${{ github.workspace }}/build/libs
- name: Upload Jar
uses: actions/upload-artifact@v3
with:
name: Jar
path: ${{ github.workspace }}/build/libs/*
if-no-files-found: error
retention-days: 14
PublishRelease:
name: Publish Release
needs: [ BuildRelease, BuildReleaseJar ]
runs-on: ubuntu-latest
steps:
- name: Download Release Artifacts
uses: actions/download-artifact@v3
- name: list artifacts
run: ls -R ./
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "*/**/*"
draft: true # This will make the release a draft, so you can edit it before publishing
token: ${{ secrets.GITHUB_TOKEN }} # This is the token to authenticate with GitHub