-
Notifications
You must be signed in to change notification settings - Fork 5
126 lines (104 loc) · 3.83 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
name: Build
on:
push:
branches:
- main
tags:
- '**'
pull_request:
branches:
- '**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PNPM
uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install
- name: Prettier
run: pnpm prettier:check
- name: Install GTK
run: sudo apt-get install libgtk-3-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev
- name: Cargo binstall
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Clippy
run: cargo clippy --workspace --all-features --all-targets
- name: Unused dependencies
run: |
cargo binstall cargo-machete --locked -y
cargo machete
- name: Fmt
run: cargo fmt --all -- --files-with-diff --check
build:
name: Bundle ${{ matrix.platform_name }}
runs-on: ${{ matrix.platform }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
platform_name: MacOS
build: 'pnpm tauri build --target universal-apple-darwin'
- platform: 'ubuntu-22.04'
platform_name: Linux
build: 'pnpm tauri build'
- platform: 'windows-latest'
platform_name: Windows (x64)
build: 'pnpm tauri build'
- platform: 'windows-latest'
platform_name: Windows (ARM)
build: 'pnpm tauri build --target aarch64-pc-windows-msvc'
- platform: 'macos-latest'
platform_name: iOS
build: 'pnpm tauri ios build'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add x86_64-apple-darwin
if: matrix.platform_name == 'MacOS'
run: rustup target add x86_64-apple-darwin
- name: Add aarch64-apple-ios
if: matrix.platform_name == 'iOS'
run: rustup target add aarch64-apple-ios
- name: Add aarch64-pc-windows-msvc
if: matrix.platform_name == 'Windows (ARM)'
run: rustup target add aarch64-pc-windows-msvc
- name: Ubuntu dependencies
if: matrix.platform == 'ubuntu-22.04'
run: sudo apt-get install -y libgtk-3-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev
- name: Windows dependencies
if: matrix.platform == 'windows-latest'
run: |
choco install nasm
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Frontend dependencies
run: pnpm install
- name: Save API key to file
if: ${{ matrix.platform == 'macos-latest' && startsWith(github.event.ref, 'refs/tags/v') }}
run: |
mkdir -p ~/private_keys
echo -n '${{ secrets.APPLE_API_SECRET_KEY }}' > ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8
- name: Notarized build
if: ${{ startsWith(github.event.ref, 'refs/tags/v') && matrix.platform == 'macos-latest' }}
run: ${{ matrix.build }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_KEY_PATH: ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8
CI: true
- name: Unnotarized build
run: ${{ matrix.build }}