This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
184 lines (160 loc) · 7.7 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
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
183
184
name: "publish"
on:
workflow_dispatch:
push:
tags:
- "*"
jobs:
publish-tauri:
strategy:
fail-fast: false
matrix:
build:
# for ubuntu with arch, we need more testing with cross compilation libraries
# since releasing on arm-linux is not a priority, we skipped it for now
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
suffix: ubuntu-x86_64-${{ github.ref_name }}
rustflags: ""
- os: macos-12
target: x86_64-apple-darwin
suffix: macos-x86_64-${{ github.ref_name }}
rustflags: ""
- os: macos-12
target: aarch64-apple-darwin
suffix: macos-aarch64-${{ github.ref_name }}
rustflags: ""
- os: windows-2022
target: x86_64-pc-windows-msvc
suffix: windows-x86_64-${{ github.ref_name }}
rustflags: ""
runs-on: ${{ matrix.build.os }}
env:
PRODUCTION_TARGET: src-tauri/target/${{ matrix.build.target }}/release/bundle
RUSTFLAGS: ${{ matrix.build.rustflags }}
steps:
- name: Maximize build space
if: runner.os == 'Linux'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: git checkout
uses: actions/checkout@v2
# For sloth256-189 Wasm support we need `llvm-ar`, which is not available by default
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "14.0"
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 16
- name: install Rust nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-08-12
target: ${{ matrix.build.target }}
components: rust-src
override: true
- name: CUDA toolchain
uses: Jimver/[email protected]
if: runner.os == 'Linux' || runner.os == 'Windows'
- name: install libdbus-1-dev and pkg-config (Linux)
run: sudo apt -y --no-install-recommends install libdbus-1-dev pkg-config
if: runner.os == 'Linux'
# Workaround to resolve link error with C:\msys64\mingw64\bin\libclang.dll
- name: Remove msys64
run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
if: runner.os == 'Windows'
- name: install webkit2gtk and libayatana (Linux)
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.0-dev libayatana-appindicator3-dev
if: runner.os == 'Linux'
# Imports PFX Certificate into keystore, allows Tauri to then sign the exe without being passed the private key.
- name: import windows certificate
if: runner.os == 'Windows'
env:
WINDOWS_PFX: ${{ secrets.CERTIFICATE_WINDOWS_PFX }}
WINDOWS_PFX_PASSWORD: ${{ secrets.CERTIFICATE_WINDOWS_PASSWORD }}
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate/tempCert.txt -Value $env:WINDOWS_PFX
certutil -decode certificate/tempCert.txt certificate/certificate.pfx
Remove-Item –path certificate -include tempCert.txt
Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_PFX_PASSWORD -Force -AsPlainText)
- name: install app dependencies
# sometimes it fails downloading packages, so set a timeout https://github.com/yarnpkg/yarn/issues/4890
run: yarn install --network-timeout 1000000
- name: OpenCL (Linux x86_64)
run: sudo apt-get install -y --no-install-recommends ocl-icd-opencl-dev
if: runner.os == 'Linux'
- name: Build (Ubuntu or Windows with OpenCL)
run: yarn build -c ./src-tauri/tauri.opencl.conf.json -- --target ${{ matrix.build.target }}
if: (runner.os == 'Linux' || runner.os == 'Windows')
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
- name: Rename OpenCL installer (Linux x86_64)
run: |
mv ${{ env.PRODUCTION_TARGET }}/deb/subspace-desktop*amd64.deb ${{ env.PRODUCTION_TARGET }}/deb/subspace-desktop-opencl_amd64.deb
if: runner.os == 'Linux'
- name: Rename OpenCL installer (Windows)
run: |
move ${{ env.PRODUCTION_TARGET }}/msi/subspace-desktop*_x64_en-US.msi ${{ env.PRODUCTION_TARGET }}/msi/subspace-desktop-opencl_x64_en-US.msi
if: runner.os == 'Windows'
- name: Build (without OpenCL)
run: yarn build -- --target ${{ matrix.build.target }}
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.MACOS_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.MACOS_IDENTITY_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
- name: Prepare installers for uploading (Ubuntu)
run: |
mkdir executables
mv ${{ env.PRODUCTION_TARGET }}/deb/subspace-desktop-opencl_amd64.deb executables/subspace-desktop-opencl_${{ matrix.build.suffix }}.deb
mv ${{ env.PRODUCTION_TARGET }}/deb/subspace-desktop*_amd64.deb executables/subspace-desktop_${{ matrix.build.suffix }}.deb
if: runner.os == 'Linux'
- name: Prepare installers for uploading (Windows)
run: |
mkdir executables
move ${{ env.PRODUCTION_TARGET }}/msi/subspace-desktop-opencl_x64_en-US.msi executables/subspace-desktop-opencl_${{ matrix.build.suffix }}.msi
move ${{ env.PRODUCTION_TARGET }}/msi/subspace-desktop_x64*_en-US.msi executables/subspace-desktop_${{ matrix.build.suffix }}.msi
if: runner.os == 'Windows'
- name: Prepare installers for uploading (macOS intel)
run: |
mkdir executables
mv ${{ env.PRODUCTION_TARGET }}/dmg/subspace-desktop*_x64.dmg executables/subspace-desktop_${{ matrix.build.suffix }}.dmg
# Zip it so that signature is not lost
ditto -c -k --rsrc executables/subspace-desktop_${{ matrix.build.suffix }}.dmg executables/subspace-desktop_${{ matrix.build.suffix }}.zip
rm executables/subspace-desktop_${{ matrix.build.suffix }}.dmg
if: matrix.build.target == 'x86_64-apple-darwin'
- name: Prepare installers for uploading (macOS arm)
run: |
mkdir executables
mv ${{ env.PRODUCTION_TARGET }}/dmg/subspace-desktop*_aarch64.dmg executables/subspace-desktop_${{ matrix.build.suffix }}.dmg
# Zip it so that signature is not lost
ditto -c -k --rsrc executables/subspace-desktop_${{ matrix.build.suffix }}.dmg executables/subspace-desktop_${{ matrix.build.suffix }}.zip
rm executables/subspace-desktop_${{ matrix.build.suffix }}.dmg
if: matrix.build.target == 'aarch64-apple-darwin'
- name: Upload executables to artifacts
uses: actions/upload-artifact@v2
with:
name: executables-${{ matrix.build.suffix }}
path: |
executables/*
if-no-files-found: error
- name: Upload executables to assets
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["executables/*"]'
if: github.event_name == 'push' && github.ref_type == 'tag'