-
Notifications
You must be signed in to change notification settings - Fork 106
157 lines (145 loc) · 4.96 KB
/
desktop_release.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
name: Desktop release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
jobs:
code_quality:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Unit tests
run: ./gradlew test
build_msi:
needs: code_quality
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build MSI
run: |
./gradlew :desktopApp:packageReleaseMsi
- name: Upload MSI
uses: actions/upload-artifact@v4
with:
name: CPU.Info-${{ github.event.inputs.version }}.msi
path: desktopApp/build/compose/binaries/main-release/msi/*.msi
build_linux_x64_uber_jar:
needs: code_quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build Uber JAR
run: ./gradlew :desktopApp:packageReleaseUberJarForCurrentOS
- name: Upload Uber JAR
uses: actions/upload-artifact@v4
with:
name: CPU-Info-linux-x64-${{ github.event.inputs.version }}-release.jar
path: desktopApp/build/compose/jars/*.jar
build_mac_dmg:
needs: code_quality
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 18
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 18
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Cache KMP tooling
uses: actions/cache@v4
with:
path: |
~/.konan
key: ${{ runner.os }}-v1-${{ hashFiles('*.versions.toml') }}
- name: Import certs
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.MAC_NOTARIZATION_CERT }}
p12-password: ${{ secrets.MAC_NOTARIZATION_CERT_PASS }}
- name: Create path variables
id: path_variables
run: |
name="CPU-Info-${{ github.event.inputs.version }}.dmg"
path="desktopApp/build/compose/binaries/main-release/dmg/${name}"
echo "RELEASE_NAME=$name" >> $GITHUB_ENV
echo "RELEASE_PATH=$path" >> $GITHUB_ENV
- name: Create and notarize DMG
run: |
./gradlew desktopApp:notarizeReleaseDmg -PmacOsNotarization=true \
-Pcompose.desktop.mac.notarization.appleID=$MAC_NOTARIZATION_ID \
-Pcompose.desktop.mac.notarization.password=$MAC_NOTARIZATION_PWD \
-Pcompose.desktop.mac.notarization.teamID=$MAC_APPSTORE_TEAM_ID
env:
MAC_NOTARIZATION_ID: ${{ secrets.MAC_NOTARIZATION_ID }}
MAC_NOTARIZATION_PWD: ${{ secrets.MAC_NOTARIZATION_PWD }}
MAC_APPSTORE_TEAM_ID: ${{ secrets.MAC_APPSTORE_TEAM_ID }}
RELEASE_PATH: ${{ env.RELEASE_PATH }}
- name: Upload DMG
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_NAME }}
path: ${{ env.RELEASE_PATH }}
tag_and_create_release:
needs: [ build_msi, build_linux_x64_uber_jar, build_mac_dmg ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download MSI
uses: actions/download-artifact@v4
with:
name: CPU.Info-${{ github.event.inputs.version }}.msi
- name: Download Linux x64 Uber JAR
uses: actions/download-artifact@v4
with:
name: CPU-Info-linux-x64-${{ github.event.inputs.version }}-release.jar
- name: Download DMG
uses: actions/download-artifact@v4
with:
name: CPU-Info-${{ github.event.inputs.version }}.dmg
- name: Tag Release
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git tag jvm-${{ github.event.inputs.version }}
git push origin jvm-${{ github.event.inputs.version }}
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "*.msi, *.jar, *.dmg"
draft: true
name: "[JVM] ${{ github.event.inputs.version }}"
tag: jvm-${{ github.event.inputs.version }}