-
Notifications
You must be signed in to change notification settings - Fork 5
105 lines (87 loc) · 3.03 KB
/
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
name: Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
release-id:
type: string
description: Optional release-id (only used when running worklfow manually)
jobs:
release-app:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest"
target: "aarch64-apple-darwin"
- platform: "macos-latest"
target: "x86_64-apple-darwin"
# - platform: "ubuntu-22.04"
# target: "aarch64-unknown-linux-gnu"
- platform: "ubuntu-22.04"
target: "x86_64-unknown-linux-gnu"
- platform: "windows-latest"
target: "aarch64-pc-windows-msvc"
- platform: "windows-latest"
target: "x86_64-pc-windows-msvc"
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
apps/core
apps/web
crates
packages
scripts
- name: Checkout MetaX's repo
uses: actions/checkout@v4
with:
repository: kareemmahlees/meta-x
path: apps/meta-x
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Rust cache
uses: swatinem/rust-cache@v2
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lock
- name: Setup Go
uses: actions/setup-go@v5
with:
cache: true
cache-dependency-path: "**/go.sum"
go-version: "stable"
- name: Build MetaX
run: go build -C ./apps/meta-x/ -o ../bin/meta-x -ldflags "-w -s"
- name: Prepare MetaX (windows)
if: matrix.platform == 'windows-latest'
run: ./scripts/prepare_metax.ps1 -target ${{matrix.target}}
- name: Prepare MetaX (mac, linux)
if: matrix.platform != 'windows-latest'
run: |
chmod +x ./scripts/prepare_metax.sh
./scripts/prepare_metax.sh ${{matrix.target}}
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
releaseId: ${{ github.event.release.id || github.event.inputs.release-id }}
includeUpdaterJson: true
projectPath: ./apps/core
tauriScript: bunx tauri
args: --ci --config src-tauri/tauri.conf.prod.json --target ${{matrix.target}} ${{ matrix.target == 'aarch64-pc-windows-msvc' && '--bundles nsis' || ''}}