-
Notifications
You must be signed in to change notification settings - Fork 7
156 lines (135 loc) · 4.3 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
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:
if: false
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 tests
build-website:
if: false
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
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-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-latest', '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 }}
publish:
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 }}
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 }}
- name: Publish to Brew
uses: ./.github/actions/publish-to-brew
with:
release-version: ${{ needs.create-release.outputs.release-version }}