-
Notifications
You must be signed in to change notification settings - Fork 3
140 lines (114 loc) · 4.68 KB
/
build-and-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
name: Build and Provide artifacts
on:
workflow_dispatch:
push:
tags: ["v*.*.*"]
pull_request:
branches:
- main
jobs:
build-linux:
name: Build for Linux and Provide artifacts
runs-on: ubuntu-latest
if: false
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Libindy
uses: ./.github/actions/setup-libindy
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build for all platforms
run: yarn --cwd packages/siera-desktop make -p linux
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch'
with:
name: siera-desktop-linux
path: ./packages/siera-desktop/out/make/**/*.*
retention-days: 7
build-macos:
name: Build for MacOS and Provide artifacts
runs-on: macos-latest
strategy:
matrix:
arch: [x64, arm64]
env:
MACOS_BUILD_CERTIFICATE_BASE64: ${{ secrets.SIERA_MACOS_BUILD_CERTIFICATE_BASE64 }}
MACOS_P12_PASSWORD: ${{ secrets.SIERA_MACOS_P12_PASSWORD }}
MACOS_BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.SIERA_MACOS_BUILD_PROVISION_PROFILE_BASE64 }}
MACOS_KEYCHAIN_PASSWORD: ${{ secrets.SIERA_MACOS_KEYCHAIN_PASSWORD }}
APPLE_API_KEY_BASE64: ${{ secrets.SIERA_APPLE_API_KEY_BASE64 }}
APPLE_API_KEY_ID: ${{ secrets.SIERA_APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.SIERA_APPLE_API_ISSUER }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install the Apple certificate and provisioning profile
env:
CERTIFICATE_PATH: ${{ runner.temp }}/build_certificate.p12
PROVISION_PROFILE_PATH: ${{ runner.temp }}/build_pp.mobileprovision
KEYCHAIN_PATH: ${{ runner.temp }}/app-signing.keychain-db
run: |
# import certificate and provisioning profile from secrets
echo -n $MACOS_BUILD_CERTIFICATE_BASE64 | base64 --decode --output $CERTIFICATE_PATH
echo -n $MACOS_BUILD_PROVISION_PROFILE_BASE64 | base64 --decode --output $PROVISION_PROFILE_PATH
# create temporary keychain
security create-keychain -p $MACOS_KEYCHAIN_PASSWORD $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p $MACOS_KEYCHAIN_PASSWORD $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P $MACOS_P12_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PROVISION_PROFILE_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Check code signing setup
run: security find-identity -p codesigning -v
- name: Setup libindy and libraries
run: |
brew install dylibbundler
sudo cp ./libs/${{ matrix.arch }}/* /usr/local/lib
- name: Change node version
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build for MacOS platform
env:
NODE_ENV: production
run: |
export APPLE_API_KEY_PATH=$RUNNER_TEMP/siera-apple-api-key.p8
echo -n "$APPLE_API_KEY_BASE64" | base64 --decode --output $APPLE_API_KEY_PATH
sudo spctl --master-disable
yarn --cwd packages/siera-desktop make -p darwin --arch ${{ matrix.arch }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch'
with:
name: siera-desktop-macos-${{ matrix.arch }}
path: ./packages/siera-desktop/out/make/**/*.*
retention-days: 7
release:
name: Create Github release from artifacts
runs-on: ubuntu-latest
needs:
- build-macos
#- build-linux
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Download built binaries
uses: actions/download-artifact@v3
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
./**/*.deb
./**/*.exe
./**/*.nupkg
./**/*.rpm
./**/*.zip
./**/*.AppImage
./**/RELEASES