-
Notifications
You must be signed in to change notification settings - Fork 2
193 lines (174 loc) · 6.55 KB
/
desktop-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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Desktop app release
permissions:
contents: write
on:
push:
tags:
- "*.*.*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
AWS_REGION: us-east-1
jobs:
build-info:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set_version.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set Version
id: set_version
run: |
VERSION=${{ github.ref_name }}
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Display Version
run: |
echo "App Version: ${{ steps.set_version.outputs.version }}"
frontend-tests:
runs-on: ubuntu-latest
needs: [build-info]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: yarn install
- name: Run tests
run: yarn test
build-binaries:
name: Build ${{ matrix.config.os }} @ ${{ matrix.config.arch }}
runs-on: ${{ matrix.config.os }}
needs: [build-info, frontend-tests]
strategy:
matrix:
config:
- os: macos-13-large
arch: x64
goarch: amd64
daemon_name: x86_64-apple-darwin
- os: macos-13-xlarge
arch: arm64
goarch: arm64
daemon_name: aarch64-apple-darwin
- os: ubuntu-latest
arch: x64
goarch: amd64
daemon_name: x86_64-unknown-linux-gnu
- os: windows-latest
arch: x64
goarch: amd64
daemon_name: x86_64-pc-windows-msvc
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/ci-setup
with:
matrix-os: ${{ matrix.config.os }}
# matrix-target: ${{ matrix.config.daemon_name }}
# matrix-arch: ${{ matrix.config.arch }}
- name: Build Backend (Unix)
if: matrix.config.os != 'windows-latest'
run: |
mkdir -p plz-out/bin/backend
go build -o plz-out/bin/backend/seed-daemon-${{ matrix.config.daemon_name }} ./backend/cmd/seed-daemon
env:
GOARCH: ${{ matrix.config.goarch }}
CGO_ENABLED: 1
- name: Build Backend (Windows)
if: startsWith(matrix.config.os, 'windows')
run: |
mkdir -p plz-out/bin/backend
go build -o plz-out/bin/backend/seed-daemon-${{ matrix.config.daemon_name }}.exe ./backend/cmd/seed-daemon
env:
GOOS: "windows"
GOARCH: ${{ matrix.config.goarch }}
CGO_ENABLED: 1
- name: Set MacOS signing certs
if: startsWith(matrix.config.os, 'macos')
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
run: |
echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p $APPLE_KEYCHAIN_PASSWORD build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p $APPLE_KEYCHAIN_PASSWORD build.keychain
security import certificate.p12 -k build.keychain -P $APPLE_CERTIFICATE_PASSWORD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: -s -k $APPLE_KEYCHAIN_PASSWORD build.keychain
rm -fr *.p12
security set-keychain-settings -lut 1200 # prevent the keychain to get locked before codesign is done
- name: Set temporal version in package.json
run: |
node scripts/set-desktop-version.mjs
env:
VITE_VERSION: "${{ needs.build-info.outputs.version }}"
- name: Build, package & make (Unix)
if: matrix.config.os != 'windows-latest'
run: |
yarn desktop:make --arch=${{ matrix.config.arch }}
env:
timeout-minutes: 10
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
DAEMON_NAME: ${{ matrix.config.daemon_name }}
VITE_VERSION: "${{ needs.build-info.outputs.version }}"
VITE_COMMIT_HASH: "${{ github.sha }}"
VITE_DESKTOP_P2P_PORT: "56000"
VITE_DESKTOP_HTTP_PORT: "56001"
VITE_DESKTOP_GRPC_PORT: "56002"
VITE_DESKTOP_APPDATA: "Seed"
VITE_DESKTOP_HOSTNAME: "http://localhost"
VITE_LIGHTNING_API_URL: "https://ln.seed.hyper.media"
VITE_GATEWAY_URL: "https://hyper.media"
VITE_DESKTOP_SENTRY_DSN: "${{ secrets.DESKTOP_SENTRY_DSN }}"
SENTRY_AUTH_TOKEN: "${{ secrets.SENTRY_AUTH_TOKEN }}"
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Build, package and make (Win32)
if: startsWith(matrix.config.os, 'windows')
run: |
yarn desktop:make --arch=${{ matrix.config.arch }}
env:
timeout-minutes: 10
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
DAEMON_NAME: "${{ matrix.config.daemon_name }}.exe"
VITE_VERSION: "${{ needs.build-info.outputs.version }}"
VITE_COMMIT_HASH: "${{ github.sha }}"
VITE_DESKTOP_P2P_PORT: "56000"
VITE_DESKTOP_HTTP_PORT: "56001"
VITE_DESKTOP_GRPC_PORT: "56002"
VITE_DESKTOP_APPDATA: "Seed"
VITE_DESKTOP_HOSTNAME: "http://localhost"
VITE_LIGHTNING_API_URL: "https://ln.seed.hyper.media"
VITE_GATEWAY_URL: "https://hyper.media"
VITE_DESKTOP_SENTRY_DSN: "${{ secrets.DESKTOP_SENTRY_DSN }}"
SENTRY_AUTH_TOKEN: "${{ secrets.SENTRY_AUTH_TOKEN }}"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.config.daemon_name }}
path: frontend/apps/desktop/out/make/**/*
publish-to-github:
needs: [build-info, build-binaries]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: "create release"
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
tag_name: "${{ needs.build-info.outputs.version }}"
prerelease: true
generate_release_notes: true
files: ./artifacts/artifacts-*/**/*