-
Notifications
You must be signed in to change notification settings - Fork 281
182 lines (171 loc) · 5.9 KB
/
ci.yaml
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
name: Produce Desktop Binary Builds
on:
workflow_dispatch:
push:
branches:
- dev
#- master
- main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
build:
#defaults:
# run:
# working-directory: GUI/ETVR
strategy:
fail-fast: false
matrix:
node-version: [18.x]
#, macos-latest
#windows-latest,
platform: [ubuntu-latest, windows-latest]
include:
#- os: ubuntu-18.04
# rust_target: x86_64-unknown-linux-gnu
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
#- os: macos-latest
# rust_target: x86_64-apple-darwin
#- os: macos-latest
# rust_target: aarch64-apple-darwin
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ env.GITHUB_TOKEN }}
- name: Build the App (Linux)
if: matrix.platform == 'ubuntu-latest'
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/zanzythebar/tauridocker:latest
options: -v ${{ github.workspace }}:/workspace
run: |
echo "::group::install node dependencies"
npm install -g pnpm
npm install -g typescript
pnpm install
echo "::group::tauri build"
pnpm tauri build
echo "::endgroup::"
- name: Archive the App (Linux)
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: production-files
path: |
src-tauri/target/release/bundle/deb/*.deb
src-tauri/target/release/bundle/appimage/*.AppImage
retention-days: 5
if-no-files-found: error
- name: Verify build (Linux)
if: matrix.platform == 'ubuntu-latest'
run: |
ls -la src-tauri/target/release/bundle/appimage
ls -la src-tauri/target/release/bundle/deb
- name: Node.js setup ${{ matrix.node-version }} (Windows & MacOS)
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
#cache: "pnpm"
# node-version-file: '.nvmrc'
- name: Install dependencies (Windows & MacOS)
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
run: |
echo "::group::install node dependencies"
npm install -g pnpm
npm install -g typescript
pnpm install
echo "::endgroup::"
- name: Setup Rust (Windows & MacOS)
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: actions-rs/toolchain@v1
with:
default: true
override: true
profile: minimal
toolchain: stable
target: ${{ matrix.platform.rust_target }}
- name: Cache Rust (Windows & MacOS)
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: Swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
- name: Build the app (Windows & MacOS)
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: JonasKruckenberg/[email protected]
id: tauri_build
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ env.APPLE_CERTIFICATE }}
#APPLE_CERTIFICATE: ${{ env.APPLE_CERTIFICATE }}
#APPLE_CERTIFICATE_PASSWORD: ${{ env.APPLE_CERTIFICATE_PASSWORD }}
#APPLE_SIGNING_IDENTITY: ${{ env.APPLE_SIGNING_IDENTITY }}
#APPLE_ID: ${{ env.APPLE_ID }}
#APPLE_PASSWORD: ${{ env.APPLE_PASSWORD }}
with:
target: ${{ matrix.platform.rust_target }}
- name: Archive the App (Windows & MacOS)
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: production-files
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}"
deploy:
runs-on: ubuntu-latest
name: Deploy
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create Directory
run: mkdir -p dist
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: production-files
path: ./dist
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install -g conventional-changelog-conventionalcommits
- run: npm install -g [email protected]
- run: npm install -g @semantic-release/exec
- run: npm install -g @semantic-release/git
- run: npm install -g @semantic-release/release-notes-generator
- run: npm install -g @semantic-release/changelog
- run: npm install -g @semantic-release/github
- name: Release
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
run: |
sudo apt-get install -y jq
chmod +x ./scripts/prepareCMD.sh
semantic-release
cleanup:
name: Cleanup actions
needs:
- deploy
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "♻️ remove build artifacts"
uses: geekyeggo/delete-artifact@v1
with:
name: production-files