-
Notifications
You must be signed in to change notification settings - Fork 43
149 lines (120 loc) · 4.61 KB
/
build.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
name: Build
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
env:
MACOSX_DEPLOYMENT_TARGET: 13
strategy:
fail-fast: false
matrix:
include:
- artifact-name: Windows-x86_64
os: windows-2022
tauri-build-flags:
- artifact-name: Windows-aarch64
os: windows-2022
tauri-build-flags: -- --target aarch64-pc-windows-msvc
- artifact-name: macOS-x86_64
os: macOS-14
tauri-build-flags: -- --target x86_64-apple-darwin
- artifact-name: macOS-arm64
os: macOS-14
tauri-build-flags: -- --target aarch64-apple-darwin
- artifact-name: Linux-x86_64
os: ubuntu-22.04
tauri-build-flags:
name: "${{ matrix.artifact-name }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Linux dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update -q
sudo apt-get install -y \
build-essential \
curl \
file \
libayatana-appindicator3-dev \
libgtk-3-dev \
librsvg2-dev \
libssl-dev \
libwebkit2gtk-4.0-dev \
wget
- name: Install Node.js dependencies
run: npm install
continue-on-error: true
- name: Set up Windows aarch64 Rust compiler
if: matrix.artifact-name == 'Windows-aarch64'
run: rustup target install aarch64-pc-windows-msvc
- name: Set up macOS x86_64 Rust compiler
if: matrix.artifact-name == 'macOS-x86_64'
run: rustup target add x86_64-apple-darwin
- run: sudo xcode-select -switch /Applications/Xcode_15.3.app
if: startsWith(matrix.os, 'macOS')
- name: Build package
run: npm run tauri build ${{ matrix.tauri-build-flags }}
- name: Upload bundle (Windows)
if: startsWith(matrix.os, 'windows')
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: src-tauri/target/**/release/bundle/nsis/*.exe
- name: Upload bundle (macOS)
if: startsWith(matrix.os, 'macOS')
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: src-tauri/target/**/release/bundle/dmg/*.dmg
- name: Upload bundle (Linux)
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: |
src-tauri/target/**/release/bundle/appimage/*.AppImage
src-tauri/target/**/release/bundle/deb/*.deb
release:
name: Create draft release
needs: [build]
runs-on: ubuntu-22.04
if: |
github.repository_owner == 'SleipnirGroup' &&
startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download prebuilt binaries
uses: actions/download-artifact@v4
with:
path: pkg
- name: Display structure of downloaded files
run: ls -R
- name: Rename Windows x86_64 bundle
working-directory: pkg/Windows-x86_64/release/bundle/nsis
run: mv *.exe Choreo-${{ github.ref_name }}-Windows-x86_64.exe
- name: Rename Windows aarch64 bundle
working-directory: pkg/Windows-aarch64/aarch64-pc-windows-msvc/release/bundle/nsis
run: mv *.exe Choreo-${{ github.ref_name }}-Windows-aarch64.exe
- name: Rename macOS x86_64 bundle
working-directory: pkg/macOS-x86_64/x86_64-apple-darwin/release/bundle/dmg
run: mv *.dmg Choreo-${{ github.ref_name }}-macOS-x86_64.dmg
- name: Rename macOS arm64 bundle
working-directory: pkg/macOS-arm64/aarch64-apple-darwin/release/bundle/dmg
run: mv *.dmg Choreo-${{ github.ref_name }}-macOS-arm64.dmg
- name: Rename Linux x86_64 file (.AppImage)
working-directory: pkg/Linux-x86_64/release/bundle/appimage
run: mv *.AppImage Choreo-${{ github.ref_name }}-Linux-x86_64.AppImage
- name: Rename Linux x86_64 file (.deb)
working-directory: pkg/Linux-x86_64/release/bundle/deb
run: mv *.deb Choreo-${{ github.ref_name }}-Linux-x86_64.deb
- name: Display structure of renamed files
run: ls -R
- uses: ncipollo/release-action@v1
with:
name: Choreo ${{ github.ref_name }}
tag: ${{ github.ref_name }}
artifacts: "pkg/**/*.AppImage,pkg/**/*.exe,pkg/**/*.deb,pkg/**/*.dmg"
draft: true
prerelease: true