forked from patschuh/KafkaEsque
-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (142 loc) · 5.24 KB
/
gradle.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
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
name: Gradle Build
on: [ push, pull_request ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-12, ubuntu-22.04, windows-2022 ]
java: [ '17' ]
fail-fast: false
name: ${{ matrix.os }}
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
java-package: jdk+fx
cache: 'gradle'
- name: Echo JAVA_HOME
run: echo $JAVA_HOME
- name: Verify Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Execute build (macOS & Ubuntu)
if: matrix.os != 'windows-2022'
run: ./gradlew --info build
- name: Execute build (Windows)
if: matrix.os == 'windows-2022'
run: .\gradlew.bat --info build
- name: Upload TAR as an artifact
if: matrix.os != 'windows-2022'
uses: actions/upload-artifact@v3
with:
name: kafkaesque-jdk${{ matrix.java }}-${{ matrix.os }}-tar
path: build/distributions/*.tar
- name: Upload ZIP as an artifact
if: matrix.os == 'windows-2022'
uses: actions/upload-artifact@v3
with:
name: kafkaesque-jdk${{ matrix.java }}-${{ matrix.os }}-zip
path: build/distributions/*.zip
- name: Execute runtime (macOS & Ubuntu)
if: matrix.os != 'windows-2022'
run: ./gradlew --info runtime
- name: Execute runtime (Windows)
if: matrix.os == 'windows-2022'
run: .\gradlew.bat --info runtime
- name: Execute jpackage (macOS & Ubuntu)
if: matrix.os != 'windows-2022'
run: ./gradlew --info jpackage
- name: Execute jpackage (Windows)
if: matrix.os == 'windows-2022'
run: .\gradlew.bat --info jpackage
- name: Upload DMG as an artifact
if: matrix.os == 'macos-12'
uses: actions/upload-artifact@v3
with:
name: kafkaesque-jdk${{ matrix.java }}-${{ matrix.os }}-dmg
path: build/jpackage/*.dmg
- name: Upload PKG as an artifact
if: matrix.os == 'macos-12'
uses: actions/upload-artifact@v3
with:
name: kafkaesque-jdk${{ matrix.java }}-${{ matrix.os }}-pkg
path: build/jpackage/*.pkg
- name: Upload DEB as an artifact
if: matrix.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v3
with:
name: kafkaesque-jdk${{ matrix.java }}-${{ matrix.os }}-deb
path: build/jpackage/*.deb
- name: Upload RPM as an artifact
if: matrix.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v3
with:
name: kafkaesque-jdk${{ matrix.java }}-${{ matrix.os }}-rpm
path: build/jpackage/*.rpm
- name: Upload EXE as an artifact
if: matrix.os == 'windows-2022'
uses: actions/upload-artifact@v3
with:
name: kafkaesque-jdk${{ matrix.java }}-${{ matrix.os }}-exe
path: build/jpackage/*.exe
- name: Upload MSI as an artifact
if: matrix.os == 'windows-2022'
uses: actions/upload-artifact@v3
with:
name: kafkaesque-jdk${{ matrix.java }}-${{ matrix.os }}-msi
path: build/jpackage/*.msi
- name: Sign release (macOS)
run: |
xattr -cr build/jpackage/*.dmg
codesign --sign - --deep --force --preserve-metadata=entitlements,requirements,flags,runtime build/jpackage/*.dmg
if: |
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'macos-12'
- name: Create release (macOS)
uses: softprops/action-gh-release@v1
if: |
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'macos-12'
with:
files: build/jpackage/*.dmg
- name: Create release (Ubuntu)
uses: softprops/action-gh-release@v1
if: |
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'ubuntu-22.04'
with:
files: |
build/jpackage/*.deb
build/jpackage/*.rpm
- name: Create release (Windows)
uses: softprops/action-gh-release@v1
if: |
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'windows-2022'
with:
files: build/jpackage/*.exe
- name: Extract version
id: extract-version
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "tag-name=${TAG_NAME:1}" >> $GITHUB_OUTPUT
- name: Bump Homebrew cask version
uses: MWin123/[email protected]
if: |
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'macos-12'
with:
formula-name: homebrew-esque
formula-path: Casks/kafkaesque.rb
homebrew-tap: patschuh/homebrew-esque
base-branch: main
create-pullrequest: true
tag-name: ${{ steps.extract-version.outputs.tag-name }}
download-url: https://github.com/patschuh/KafkaEsque/releases/download/v${{ steps.extract-version.outputs.tag-name }}/kafkaesque-${{ steps.extract-version.outputs.tag-name }}.dmg
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}