This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
118 lines (101 loc) · 3.4 KB
/
publish.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
name: Publish Electron
on:
workflow_dispatch:
inputs:
version:
description: "The new version in X.Y.Z format."
required: true
jobs:
publish:
continue-on-error: true
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
package_arg: --mac --arm64
arch: arm64
target: aarch64-apple-darwin
- os: macos-latest
package_arg: --mac
target: x86_64-apple-darwin
arch: x64
- os: windows-latest
package_arg: --win --x64
target: x86_64-pc-windows-msvc
arch: x64
defaults:
run:
working-directory: "crates/taker-electron"
steps:
- name: Checkout tagged commit
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.ITCHY_GITHUB_TOKEN }}
- name: Fetch all tags (workaround for https://github.com/actions/checkout/issues/290)
run: git fetch --tags --force
- name: Setup rust toolchain
working-directory: "./"
run: rustup show
- uses: Swatinem/[email protected]
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup rust targets for aarch64-apple-darwin
if: matrix.target == 'aarch64-apple-darwin'
run: rustup target add aarch64-apple-darwin
- name: Install Node and Yarn
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
cache-dependency-path: |
taker-frontend/yarn.lock
crates/taker-electron/package-lock.json
- name: Build taker frontend
working-directory: taker-frontend
shell: bash
run: |
yarn
yarn build
- name: Bump version in package.json to ${{github.event.inputs.version}}
uses: jaywcjlove/github-action-package@main
with:
path: crates/taker-electron/release/app/package.json
data: |
{
"version": "${{github.event.inputs.version}}"
}
- name: Install dependencies for taker-electron
run: |
yarn install
- name: Run install-app-deps for taker-electron
run: |
yarn run build:dll
- name: Build dll
run: |
yarn electron-builder -- install-app-deps --arch=${{matrix.arch}}
- name: Build rust files ${{matrix.target}}
run: |
yarn run build:rust --release --target=${{matrix.target}}
- name: Build electron files main
run: |
yarn run build:main
- name: Build electron files rendered
run: |
yarn run build:renderer
- name: Publish releases
env:
# These values are used for auto updates signing
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
# This is used for uploading release assets to github
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Enforce that electron-builder does not skip publication if the release was created more than two hours ago
EP_GH_IGNORE_TIME: true
run: |
yarn electron-builder -- --publish always ${{matrix.package_arg}}