-
Notifications
You must be signed in to change notification settings - Fork 32
155 lines (127 loc) · 4.8 KB
/
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
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
name: Release native version
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
create-gh-release:
runs-on: ubuntu-latest
steps:
- name: Create Release
# as electron-builder needs draft to upload artifacts, create a draft first
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
release-electron:
needs: create-gh-release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-2019]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'npm'
- name: Install libs on ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt install -y libusb-1.0-0-dev libudev-dev
- name: Install Dependencies
run: npm ci
- name: Build and Release
run: npx quasar build -m electron
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
release-electron-macos:
needs: create-gh-release
runs-on: self_mac_11.0
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: npm ci
- name: Setup macOS Notarization env
run: |
rm -fr ~/private_keys && mkdir ~/private_keys
echo $APPLE_AUTH_PRIVATE_KEY | base64 -D > ~/private_keys/AuthKey_${APPLE_API_KEY_ID}.p8
env:
APPLE_AUTH_PRIVATE_KEY: ${{secrets.APPLE_AUTH_PRIVATE_KEY}}
APPLE_API_KEY_ID: ${{secrets.APPLE_API_KEY_ID}}
- name: Build and Release
run: npx quasar build -m electron
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
release-android:
needs: create-gh-release
runs-on: self_mac_11.0
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: npm ci
- name: Build bundle
run: npx quasar build -m android -- -- --packageType=bundle
- name: Copy built aab file
run: |
mkdir -p dist/android/bundle
cp dist/cordova/android/bundle/release/*.aab dist/android/bundle/
- name: Build apk
run: npx quasar build -m android -- -- --packageType=apk
- name: Copy built apk file
run: |
mkdir -p dist/android/apk
cp dist/cordova/android/apk/release/*.apk dist/android/apk/
- uses: r0adkll/sign-android-release@v1
name: Sign APK
id: sign_apk
with:
releaseDirectory: dist/android/apk
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "32.0.0"
- uses: r0adkll/sign-android-release@v1
name: Sign Bundle
id: sign_bundle
with:
releaseDirectory: dist/android/bundle
signingKeyBase64: ${{ secrets.UPLOAD_KEY }}
alias: ${{ secrets.UPLOAD_KEY_ALIAS }}
keyStorePassword: ${{ secrets.UPLOAD_KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.UPLOAD_KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "32.0.0"
- name: Set up variable
id: vars
run: echo "tag=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Rename apk file
run: mv ${{steps.sign_apk.outputs.signedReleaseFile}} dist/android/apk/Sync2-android-${{ steps.vars.outputs.tag }}.apk
- name: Rename bundle file
run: mv ${{steps.sign_bundle.outputs.signedReleaseFile}} dist/android/bundle/Sync2-android-${{ steps.vars.outputs.tag }}.aab
- name: Calculate checksum of output file
run: shasum -a 512 dist/android/apk/Sync2-android-${{ steps.vars.outputs.tag }}.apk | cut -f1 -d\ | xxd -r -p | base64 -b 0 > dist/android/apk/Sync2-android-${{ steps.vars.outputs.tag }}-apk-SHASUM
- name: Upload apk to GH release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
dist/android/apk/Sync2-android-${{ steps.vars.outputs.tag }}.apk
dist/android/apk/Sync2-android-${{ steps.vars.outputs.tag }}-apk-SHASUM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload aab to artifacts
uses: actions/upload-artifact@v3
with:
path: dist/android/bundle/Sync2-android-${{ steps.vars.outputs.tag }}.aab