-
-
Notifications
You must be signed in to change notification settings - Fork 40
143 lines (121 loc) · 4.75 KB
/
build-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
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
name: Create Release Build
on: [workflow_dispatch, workflow_call]
jobs:
get_version:
name: "Version"
uses: ./.github/workflows/get-version.yml
build_windows:
name: "Create Windows Build"
runs-on: windows-latest
needs: [get_version]
steps:
# Firstly Checkout our Repository..
- name: "Check out GoXLR Utility"
uses: actions/checkout@v3
with:
path: goxlr-utility
# Now Checkout the App Wrappers repository..
- name: "Check out GoXLR Utility UI"
uses: actions/checkout@v3
with:
repository: frostycoolslug/goxlr-utility-ui
path: goxlr-utility-ui
# For the use of CI, we need the UI to use the 'local' version of the `goxlr-ipc` crate, rather than the latest
# release version, this is to allow test builds to work correctly in the event of a Status Structure change that
# hasn't yet been released.
- name: "Update Utility UI IPC Location"
uses: Nambers/ReplaceStringInFile@v1.3
with:
path: "goxlr-utility-ui/src-tauri/Cargo.toml"
regexOptions: 'gm'
oldString: "^goxlr-ipc.*$"
newString: "goxlr-ipc = { path = \\\"../../goxlr-utility/ipc\\\" }"
showFileContent: true
- name: "Install Rust"
uses: dtolnay/rust-toolchain@stable
- name: "Loading Cache"
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
goxlr-utility/target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release-
- name: "Build Utility"
run: "cargo build --manifest-path=goxlr-utility/Cargo.toml --release --all-features"
# Build the UI into the same target directory..
- name: "Build UI"
run: "cargo build --manifest-path=goxlr-utility-ui/src-tauri/Cargo.toml --target-dir=goxlr-utility/target --release"
# Prepare NSIS
- name: "Preparing NSIS"
run: mkdir -p ${{ github.workspace }}/NSIS_Plugins/x86-unicode/
- name: "Downloading Tauri Utility Plugin"
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.1.1/nsis_tauri_utils.dll
target: ${{ github.workspace }}/NSIS_Plugins/x86-unicode/
- name: "Downloading WebView2 Bootstrapper"
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://go.microsoft.com/fwlink/p/?LinkId=2124703
target: goxlr-utility/ci/nsis/MicrosoftEdgeWebview2Setup.exe
- name: "Downloading VC Runtime"
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://aka.ms/vs/17/release/vc_redist.x64.exe
target: goxlr-utility/ci/nsis/vc_redist.x64.exe
- name: "Build NSIS Packages"
uses: joncloud/makensis-action@publish
with:
additional-plugin-paths: ${{ github.workspace }}/NSIS_Plugins
script-file: goxlr-utility/ci/nsis/goxlr-utility.nsi
arguments: "/DPRODUCT_VERSION=${{ needs.get_version.outputs.version }}"
- name: "Upload Installer"
uses: actions/upload-artifact@v3
with:
name: windows-artifact
path: ./goxlr-utility/ci/Output/*.exe
build:
name: "Create Linux Builds"
runs-on: ubuntu-latest
needs: [get_version]
steps:
- name: "Check out Repository"
uses: actions/checkout@v3
- name: "Install Rust"
uses: dtolnay/rust-toolchain@stable
- name: "Install Required Libraries"
run: |
sudo apt-get update
sudo apt-get install libpulse0 libdbus-1-dev pkg-config libspeechd-dev
- name: "Loading Cache"
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release-
- name: Install cargo-deb and cargo-generate-rpm
run: cargo install --force cargo-deb cargo-generate-rpm
- name: "Build Packages"
run: ./ci/build-packages
shell: bash
- name: "Upload DEB Artifact"
uses: actions/upload-artifact@v3
with:
name: debian-artifact
path: ./target/debian/*.deb
- name: "Upload RPM Artifact"
uses: actions/upload-artifact@v3
with:
name: rpm-artifact
path: ./target/generate-rpm/*.rpm