-
Notifications
You must be signed in to change notification settings - Fork 9
195 lines (168 loc) · 5.46 KB
/
release.yaml
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
194
195
name: Release
on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '**.md'
- '.vscode/**'
- '.idea/**'
workflow_dispatch:
inputs:
production-release:
description: 'Production release?'
required: true
default: 'true'
concurrency: create-release
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
packages: read
jobs:
ci:
name: CI
uses: makerxstudio/shared-config/.github/workflows/node-ci.yml@main
with:
working-directory: .
node-version: 20.x
audit-script: npm run audit
compile-script: npm run check-types
test-script: npm run test
build-website:
name: Build Website
uses: makerxstudio/shared-config/.github/workflows/node-build-zip.yml@main
with:
node-version: 20.x
build-path: dist
artifact-name: website
static-site: true
static-site-env-prefix: VITE
needs:
- ci
create-release:
runs-on: [ubuntu-20.04]
name: Create release
needs:
- ci
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create release
id: create-release-action
uses: ./.github/actions/create-release
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
production-release: ${{ github.ref_name == 'main' && inputs.production-release == 'true' }}
node-version: 20
outputs:
release-published: ${{ steps.create-release-action.outputs.release-published }}
release-version: ${{ steps.create-release-action.outputs.release-version }}
release-tag: ${{ steps.create-release-action.outputs.release-tag }}
release-id: ${{ steps.create-release-action.outputs.release-id }}
build-tauri:
name: Build Tauri app
needs:
- create-release
runs-on: ${{ matrix.platform }}
strategy:
matrix:
# macos-14 is the Apple Silicon M1 runner
platform: [ubuntu-20.04, windows-latest, 'macos-12', 'macos-14']
if: ${{ needs.create-release.outputs.release-published == 'true' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install npm dependencies
run: npm install
- name: Build for Linux
id: build-linux
if: ${{ runner.os == 'Linux' }}
uses: ./.github/actions/build-linux
with:
release-version: ${{ needs.create-release.outputs.release-version }}
- name: Build for Windows
id: build-windows
if: ${{ runner.os == 'Windows' }}
uses: ./.github/actions/build-windows
with:
production-release: ${{ inputs.production-release }}
release-version: ${{ needs.create-release.outputs.release-version }}
- name: Build for Mac
id: build-mac
if: ${{ runner.os == 'macOS' }}
uses: ./.github/actions/build-mac
with:
production-release: ${{ inputs.production-release }}
release-version: ${{ needs.create-release.outputs.release-version }}
outputs:
linux-artifact-name: ${{ steps.build-linux.outputs.artifact-name }}
deploy-website-staging:
name: Publish Website to Staging
needs:
- build-website
runs-on: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: website
path: artifacts
- name: Display structure of downloaded files
run: |
cd artifacts
ls -R
- name: Unzip
run: |
cd artifacts
mkdir -p website
unzip website.zip -d website
- name: Handle Netlify redirect
run: |
echo "/* /index.html 200" > artifacts/website/_redirects
- name: Deploy website to Netlify
run: |
npx netlify-cli deploy --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --dir artifacts/website --alias staging
publish-app:
name: Publish
needs:
- create-release
- build-tauri
runs-on: [ubuntu-20.04]
if: ${{ inputs.production-release == 'true' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Publish to Snap
uses: ./.github/actions/publish-to-snap
with:
release-version: ${{ needs.create-release.outputs.release-version }}
release-tag: ${{ needs.create-release.outputs.release-tag }}
artifact-name: ${{ needs.build-tauri.outputs.linux-artifact-name }}
- name: Publish to Winget
uses: ./.github/actions/publish-to-winget
with:
release-version: ${{ needs.create-release.outputs.release-version }}
release-tag: ${{ needs.create-release.outputs.release-tag }}
- name: Publish to Brew
uses: ./.github/actions/publish-to-brew
with:
release-version: ${{ needs.create-release.outputs.release-version }}
release-tag: ${{ needs.create-release.outputs.release-tag }}