-
Notifications
You must be signed in to change notification settings - Fork 4
140 lines (119 loc) · 4.52 KB
/
release-ci.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
name: Aesir Release Pipeline
on:
push:
branches:
- master
tags:
- '*'
jobs:
create-release:
name: Create GitHub Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{steps.create_release.outputs.upload_url}}
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
build:
name: "Build: ${{ matrix.config.name }} / ${{ matrix.config.platform }}"
runs-on: ${{ matrix.config.os }}
needs: [create-release]
strategy:
fail-fast: true
matrix:
config:
- {
name: "Windows Latest",
os: windows-latest,
platform: x64
}
- {
name: "Ubuntu Latest",
os: ubuntu-latest,
platform: x64
}
- {
name: "macOS-x64",
os: macos-latest,
platform: x64
}
- {
name: "macOS arm64",
os: macos-latest,
platform: arm64
}
env:
PLATFORM: ${{ matrix.config.platform }}
VERSION: ${{ github.ref_name }} # This extracts the tag name
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 18.13.0
- name: Install python-setuptools on macOS
if: matrix.config.os == 'macos-11' || matrix.config.os == 'macos-latest'
run: brew install python-setuptools
- name: Install snap on Linux
if: matrix.config.os == 'ubuntu-latest'
run: sudo snap install snapcraft --classic
- name: Install libudev on Linux
if: matrix.config.os == 'ubuntu-latest'
run: sudo apt-get install -y libudev-dev
- name: Install the Apple certificate and provisioning profile
if: matrix.config.os == 'macos-latest'
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/61be0696-8d71-4a17-8f96-53c50b8c6fdd.provisionprofile
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# Import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_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 "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# Apply provisioning profile
mkdir -p ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles
cp $PP_PATH ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH .
cp $PP_PATH bin/
ls
ls bin
security find-identity -p codesigning -v
- name: Install dependencies
run: npm install --quiet
- name: Build ${{ matrix.config.name }}
if: matrix.config.os == 'windows-latest'
run: npm run build:win-x64
- name: Build ${{ matrix.config.name }}
if: matrix.config.os == 'ubuntu-latest'
run: npm run build:linux-$PLATFORM
- name: Build ${{ matrix.config.name }}
if: matrix.config.os == 'macos-latest'
env:
appleId: ${{ secrets.APPLE_ID }}
appleIdPassword: ${{ secrets.APP_SPECIFIC_PASSWORD }}
teamId: ${{ secrets.TEAM_ID }}
run: npm run build:mac-$PLATFORM