This repository has been archived by the owner on May 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (75 loc) · 3.01 KB
/
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
name: Release
on:
release:
types: [created]
jobs:
release:
runs-on: ${{matrix.os}}
permissions:
contents: read
packages: write
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Install required build toolchain
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y libarchive-tools snapd
- name: Install snapcraft
if: matrix.os == 'ubuntu-latest'
run: sudo snap install snapcraft --classic
- name: Login into snapcraft
if: matrix.os == 'ubuntu-latest'
run: |
echo "$SNAPCRAFT_TOKEN" > $RUNNER_TEMP/snapcraft-token
snapcraft login --with $RUNNER_TEMP/snapcraft-token
env:
SNAPCRAFT_TOKEN: ${{ secrets.SNAPCRAFT_TOKEN }}
- name: Configure Fontawesome
uses: DamianReeves/[email protected]
with:
path: .npmrc
contents: |
//npm.pkg.github.com/:_authToken=${{ secrets.GHR_TOKEN }}
//npm.fontawesome.com/:_authToken=${{ secrets.FONTAWESOME_TOKEN }}
write-mode: append
- name: Install the Apple certificate and provisioning profile
if: matrix.os == 'macos-latest'
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
AUTHKEY_PATH=$RUNNER_TEMP/authkey.p8
echo -n "$APPLE_API_KEY" > $AUTHKEY_PATH
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- run: cat $RUNNER_TEMP/authkey.p8
if: matrix.os == 'macos-latest'
- uses: pnpm/[email protected]
with:
version: "6.x"
run_install: true
- run: pnpm run build:publish
env:
APPLE_API_KEY: ${{ runner.temp }}/authkey.p8
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
DO_KEY_ID: ${{ secrets.DO_KEY_ID }}
DO_SECRET_KEY: ${{ secrets.DO_SECRET_KEY }}
TEAM_SHORT_NAME: ${{ secrets.TEAM_SHORT_NAME }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}