forked from mucommander/mucommander
-
Notifications
You must be signed in to change notification settings - Fork 0
225 lines (180 loc) · 8.04 KB
/
stable.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
name: Stable Build
on:
workflow_dispatch:
jobs:
create-release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ steps.mucommander_version.outputs.VERSION }}
full_version: ${{ steps.mucommander_version.outputs.FULL_VERSION }}
steps:
- uses: actions/checkout@v4
- name : Get version
id: mucommander_version
run: |
echo "FULL_VERSION=$(${{github.workspace}}/gradlew -q printFullVersionName)" >> $GITHUB_OUTPUT
echo "VERSION=$(${{github.workspace}}/gradlew -q printVersionName)" >> $GITHUB_OUTPUT
- name: Create a new release
uses: softprops/action-gh-release@v1
id: create_release
with:
name: "${{ steps.mucommander_version.outputs.VERSION }}"
tag_name: "${{ steps.mucommander_version.outputs.FULL_VERSION }}"
prerelease: false
draft: true
target_commitish: "${{ github.ref_name }}"
upload-macos-artifacts:
strategy:
matrix:
include:
- arch: aarch64
os: macos-14
- arch: x86_64
os: macos-12
runs-on: ${{ matrix.os }}
needs: create-release
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout 'release'
uses: actions/checkout@v4
with:
repository: mucommander/release
path: release
token: ${{ secrets.RELEASE_REPO_TOKEN }}
- name: Apply 'release' patches
run: |
git config --global user.name gh-action
git config --global user.email gh-action
git am release/0001-set-credentials-to-Google-Drive.patch
git am release/0002-set-credentials-to-Dropbox.patch
git am release/0005-set-credentials-to-OneDrive.patch
- uses: actions/setup-java@v4
with:
java-version: '18'
distribution: 'adopt'
- uses: gradle/actions/setup-gradle@v3
- name: Setup keychain
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}
- name: Build dmg
run: ./gradlew dmg -Parch=${{ matrix.arch }} -Pidentity="${{ secrets.MACOS_IDENTITY }}"
- name: Sign dmg
run: /usr/bin/codesign --entitlements package/osx/mucommander-entitlements --timestamp --options runtime --deep --force -s "${{ secrets.MACOS_IDENTITY }}" "./build/distributions/mucommander-${{ needs.create-release.outputs.full_version }}-${{ matrix.arch }}.dmg" -v
- name: Notarize dmg
run: |
xcrun notarytool submit "./build/distributions/mucommander-${{ needs.create-release.outputs.full_version }}-${{ matrix.arch }}.dmg" --apple-id ${{ secrets.MACOS_APPLE_ID }} --password ${{ secrets.MACOS_APP_SPECIFIC_PASSWORD }} --team-id ${{ secrets.MACOS_TEAM_ID }} --wait | tee output.log
ID=$(grep 'id:' output.log | head -n 1 | awk '{print $2}')
echo $ID
xcrun notarytool log --apple-id ${{ secrets.MACOS_APPLE_ID }} --password ${{ secrets.MACOS_APP_SPECIFIC_PASSWORD }} --team-id ${{ secrets.MACOS_TEAM_ID }} $ID
grep -vqz "status: Invalid" output.log
- name: Staple dmg
run: xcrun stapler staple "./build/distributions/mucommander-${{ needs.create-release.outputs.full_version }}-${{ matrix.arch }}.dmg"
- name: Upload dmg
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: "./build/distributions/mucommander-${{ needs.create-release.outputs.full_version }}-${{ matrix.arch }}.dmg"
asset_content_type: application/octet-stream
upload-linux-artifacts:
runs-on: ubuntu-latest
needs: create-release
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-java@v4
with:
java-version: '20'
distribution: 'adopt'
- name: Checkout 'release'
uses: actions/checkout@v4
with:
repository: mucommander/release
path: release
token: ${{ secrets.RELEASE_REPO_TOKEN }}
- name: Apply 'release' patches
run: |
git config --global user.name gh-action
git config --global user.email gh-action
git am release/0001-set-credentials-to-Google-Drive.patch
git am release/0002-set-credentials-to-Dropbox.patch
git am release/0005-set-credentials-to-OneDrive.patch
- uses: gradle/actions/setup-gradle@v3
- name: Build portable, tgz, deb, and rpm
run: ./gradlew tgz portable deb rpm
- name: list artifacts
run: ls ./build/distributions
- name: Import GPG
run: gpg --passphrase ${{ secrets.PASSPHRASE }} --pinentry-mode loopback --import release/rpm/.gpg
- name: Set .rpmmacros
run: |
cat << EOF > ~/.rpmmacros
%_signature gpg
%_gpg_name Arik Hadas
%_gpgbin /usr/bin/gpg2
%__gpg_sign_cmd %{__gpg} gpg --force-v3-sigs --batch --passphrase ${{ secrets.PASSPHRASE }} --pinentry-mode loopback --verbose --no-armor --no-secmem-warning -u "%{_gpg_name}" -sbo %{__signature_filename} --digest-algo sha256 %{__plaintext_filename}'
EOF
- name: Sign rpm
run: rpmsign --key-id='Arik Hadas' --addsign "./build/distributions/mucommander-${{ needs.create-release.outputs.full_version }}.x86_64.rpm"
- name: Upload portable
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: "./build/distributions/mucommander-${{ needs.create-release.outputs.full_version }}-portable.zip"
asset_content_type: application/zip
- name: Upload tgz
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: "./build/distributions/mucommander-${{ needs.create-release.outputs.full_version }}.tgz"
asset_content_type: application/gzip
- name: Upload deb
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: "./build/distributions/mucommander_${{ needs.create-release.outputs.version }}_amd64.deb"
asset_content_type: application/octet-stream
- name: Upload rpm
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: "./build/distributions/mucommander-${{ needs.create-release.outputs.full_version }}.x86_64.rpm"
asset_content_type: application/octet-stream
upload-windows-artifacts:
runs-on: windows-latest
needs: create-release
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-java@v4
with:
java-version: '20'
distribution: 'adopt'
- name: Checkout 'release'
uses: actions/checkout@v4
with:
repository: mucommander/release
path: release
token: ${{ secrets.RELEASE_REPO_TOKEN }}
- name: Apply 'release' patches
run: |
git config --global user.name gh-action
git config --global user.email gh-action
git am release/0001-set-credentials-to-Google-Drive.patch
git am release/0002-set-credentials-to-Dropbox.patch
git am release/0005-set-credentials-to-OneDrive.patch
- uses: gradle/actions/setup-gradle@v3
- name: Build msi
run: ./gradlew msi
- name: Upload msi
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: "./build/distributions/mucommander-${{ needs.create-release.outputs.version }}.msi"
asset_content_type: application/octet-stream