-
Notifications
You must be signed in to change notification settings - Fork 14
184 lines (154 loc) · 5.05 KB
/
build.yml
File metadata and controls
184 lines (154 loc) · 5.05 KB
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
name: Build and Release
on:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main ]
workflow_dispatch:
env:
RUST_BACKTRACE: 1
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run linting
run: bun run lint
- name: Run type checking
run: bun run typecheck
- name: Run tests
run: bun run test:jest
# - name: Setup tmate session (for debugging)
# if: failure() || github.event_name == 'workflow_dispatch'
# uses: mxschmitt/action-tmate@v3
# timeout-minutes: 3
build:
name: Build - ${{ matrix.platform.target }}
needs: test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} # Repository Secret
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
bundles: appimage,deb
- os: macos-latest
target: x86_64-apple-darwin
bundles: dmg
- os: macos-latest
target: aarch64-apple-darwin
bundles: dmg
- os: windows-latest
target: x86_64-pc-windows-msvc
bundles: nsis,msi
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform.target }}
- name: Install system dependencies (Ubuntu)
if: matrix.platform.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
src-tauri/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Cache Node modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install frontend dependencies
run: bun install
- name: Build Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
target: ${{ matrix.platform.target }}
args: --bundles ${{ matrix.platform.bundles }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: minecraft-mods-localizer-${{ matrix.platform.target }}
path: |
src-tauri/target/release/bundle/**/*.AppImage
src-tauri/target/release/bundle/**/*.deb
src-tauri/target/release/bundle/**/*.dmg
src-tauri/target/release/bundle/**/*.exe
src-tauri/target/release/bundle/**/*.msi
retention-days: 7
release:
name: Create Release
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create release
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: false
generate_release_notes: true
files: |
artifacts/**/*.AppImage
artifacts/**/*.deb
artifacts/**/*.dmg
artifacts/**/*.exe
artifacts/**/*.msi
body: |
## What's Changed
<!-- Add your release notes here -->
## Installation
### Windows
- Download the `.exe` or `.msi` installer for your system
### macOS
- Download the `.dmg` file for your architecture (Intel or Apple Silicon)
### Linux
- Download the `.AppImage` (universal) or `.deb` (Debian/Ubuntu) package
## Checksums
<!-- Checksums will be automatically generated -->