forked from Sjj1024/PakePlus
-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (126 loc) · 5 KB
/
build.yml
File metadata and controls
140 lines (126 loc) · 5 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
name: Release
on:
workflow_dispatch:
inputs:
build_macos_aarch64:
description: 'Build for macOS aarch64'
required: false
type: boolean
default: false
build_macos_x86_64:
description: 'Build for macOS x86_64'
required: false
type: boolean
default: false
build_linux_x86_64:
description: 'Build for Linux x86_64'
required: false
type: boolean
default: false
build_linux_aarch64:
description: 'Build for Linux aarch64'
required: false
type: boolean
default: false
build_windows_x86_64:
description: 'Build for Windows x86_64'
required: false
type: boolean
default: false
build_windows_aarch64:
description: 'Build for Windows aarch64'
required: false
type: boolean
default: false
push:
tags:
- 'v*'
# branches:
# - 'main'
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
target: 'aarch64-apple-darwin'
args: '--target aarch64-apple-darwin'
enabled: ${{ github.event.inputs.build_macos_aarch64 == 'true' }}
- platform: 'macos-latest'
target: 'x86_64-apple-darwin'
args: '--target x86_64-apple-darwin'
enabled: ${{ github.event.inputs.build_macos_x86_64 == 'true' }}
- platform: 'ubuntu-22.04'
target: 'x86_64-unknown-linux-gnu'
args: ''
enabled: ${{ github.event.inputs.build_linux_x86_64 == 'true' }}
- platform: 'ubuntu-22.04'
target: 'aarch64-unknown-linux-gnu'
args: ''
enabled: ${{ github.event.inputs.build_linux_aarch64 == 'true' }}
- platform: 'windows-latest'
target: 'x86_64-pc-windows-msvc'
args: ''
enabled: ${{ github.event.inputs.build_windows_x86_64 == 'true' }}
- platform: 'windows-latest'
target: 'aarch64-pc-windows-msvc'
args: '--target aarch64-pc-windows-msvc'
enabled: ${{ github.event.inputs.build_windows_aarch64 == 'true' }}
runs-on: ${{ matrix.platform }}
timeout-minutes: 60
steps:
- name: Checkout Repository
if: ${{ matrix.enabled }}
uses: actions/checkout@v4
- name: Install rust target
if: ${{ matrix.enabled }}
run: rustup target add ${{ matrix.target }}
- name: Setup pnpm
if: ${{ matrix.enabled }}
uses: pnpm/action-setup@v3
with:
version: latest
- name: Sync node version and setup cache
if: ${{ matrix.enabled }}
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install frontend dependencies
if: ${{ matrix.enabled }}
run: pnpm install
- name: install Rust stable
if: ${{ matrix.enabled }}
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Regenerate Icons
if: ${{ matrix.enabled }}
run: pnpm tauri icon
- name: Init Project Config
if: ${{ matrix.enabled }}
run: node ./scripts/ppworker.cjs
- name: install dependencies (ubuntu only)
if: ${{ matrix.enabled && 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: tauri release
if: ${{ matrix.enabled }}
uses: Sjj1024/tauri-zhaction@tauri-zhaciton
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NAME: ${{ env.NAME }}
VERSION: ${{ env.VERSION }}
PUBBODY: ${{ env.PUBBODY }}
with:
tagName: '${{ env.NAME }}'
releaseName: '${{ env.NAME }} v${{ env.VERSION }}'
releaseBody: '${{ env.PUBBODY }}'
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}
renameArtifacts: '${{ env.NAME }}'