This repository has been archived by the owner on Jan 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 99
134 lines (124 loc) · 4.25 KB
/
main.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
name: "deploy"
on:
push:
branches:
- main
jobs:
build_desktop:
strategy:
matrix:
platform:
# X86+64 is built with ARM64 also
- darwin+aarch64
uses: ./.github/workflows/build-sign-notarize.yml
with:
platform: ${{ matrix.platform }}
s3-prefix: main
debug: 1
sync-translation: 1
secrets: inherit
upload:
needs: [build_desktop]
if: needs.build_desktop.outputs.s3-electron-dist-key != ''
runs-on: ubuntu-latest
strategy:
matrix:
platform:
# - linux+x86-64
- darwin+aarch64
# - linux+aarch64
steps:
- uses: actions/checkout@v3
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: s3 artifact download
env:
S3_INSTALLER_KEY: ${{ secrets.BUILDS_S3_BUCKET }}/${{ needs.build_desktop.outputs.s3-electron-dist-key }}
run: aws s3 cp $S3_INSTALLER_KEY dist.tgz
- run: |
mkdir dist
tar xzf dist.tgz -C dist
- name: get installer filenames of arm64 and x86+64
id: app_files
working-directory: ./dist
run: |
ARM64_ZIP=$(ls | grep -Ev blockmap | grep arm64-mac.zip)
X86_ZIP=$(ls | grep -Ev blockmap | grep -Ev arm64 | grep mac.zip)
ARM64_DMG=$(ls | grep -Ev blockmap | grep arm64.dmg)
X86_DMG=$(ls | grep -Ev blockmap | grep -Ev arm64 | grep dmg)
echo zip_arm64=$ARM64_ZIP >> $GITHUB_OUTPUT
echo zip_x86=$X86_ZIP >> $GITHUB_OUTPUT
echo dmg_arm64=$ARM64_DMG >> $GITHUB_OUTPUT
echo dmg_x86=$X86_DMG >> $GITHUB_OUTPUT
- name: Get current unix ts - seconds
id: date
run: echo "unix_seconds=$(date +'%s')" >> $GITHUB_OUTPUT
- name: build platform output
id: build_platform
env:
platform: ${{ matrix.platform }}
run: |
BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g")
EXTENSION=dmg
case $platform in
"linux+x86-64")
BUILD_PLATFORM="amd64"
EXTENSION="deb"
;;
"linux+aarch64")
BUILD_PLATFORM="aarch64"
EXTENSION="deb"
;;
"darwin+aarch64")
BUILD_PLATFORM="aarch64"
EXTENSION="dmg"
;;
"darwin+x86-64")
BUILD_PLATFORM="x64"
EXTENSION="dmg"
;;
*)
echo "Unknown platform $platform"
exit 1
;;
esac
echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT
echo "extension=$EXTENSION" >> $GITHUB_OUTPUT
- name: cp package images from prod to gui bucket
env:
arm64: ${{ steps.app_files.outputs.dmg_arm64 }}
x86: ${{ steps.app_files.outputs.dmg_x86 }}
bucket: ${{ secrets.BUILDS_S3_BUCKET }}
run: |
cd dist && \
aws s3 sync . "$bucket/dev/"
- uses: actions/setup-node@v3
with:
node-version: 18
- name: get version
id: get-version
run: |
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Slack Notification ARM64
run: ./.github/notify-slack.js
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
PLATFORM: darwin-aarch64
EXT: dmg
VERSION: ${{ steps.get-version.outputs.version }}-dev
DOWNLOAD_URL: ${{ secrets.BUILDS_S3_PUBLIC_DOMAIN }}/dev/${{ steps.app_files.outputs.dmg_arm64 }}
- name: Slack Notification X86
run: ./.github/notify-slack.js
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
PLATFORM: darwin-x86+64
EXT: dmg
VERSION: ${{ steps.get-version.outputs.version }}-dev
DOWNLOAD_URL: ${{ secrets.BUILDS_S3_PUBLIC_DOMAIN }}/dev/${{ steps.app_files.outputs.dmg_x86 }}
- run: |
aws cloudfront create-invalidation \
--distribution-id ${{ secrets.AWS_CF_GUI_RELEASE_ID }} \
--paths '/*'