-
Notifications
You must be signed in to change notification settings - Fork 16
142 lines (125 loc) · 4.14 KB
/
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
---
name: Release
'on':
push:
paths-ignore:
- '**/*.md'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- 'main'
- 'build-*'
workflow_dispatch:
jobs:
builds:
strategy:
fail-fast: false
matrix:
platform: [
macos-latest,
ubuntu-latest,
]
# windows-latest,
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Node.js setup
uses: actions/setup-node@v4
with:
node-version: "20"
cache: 'yarn'
- name: Rust setup (native)
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Rust setup (macOS/aarch64)
if: startsWith(runner.os,'macOS')
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: aarch64-apple-darwin
override: true
- name: Cache cargo files and outputs
uses: Swatinem/rust-cache@v2
- name: Install dependencies (Linux)
if: startsWith(runner.os,'Linux')
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
webkit2gtk-4.0 \
libappindicator3-dev \
librsvg2-dev \
patchelf
- name: Install dependencies (macOS)
if: startsWith(runner.os,'macOS')
run: |
brew install openssl
echo "AARCH64_APPLE_DARWIN_OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include" >> $GITHUB_ENV
echo "AARCH64_APPLE_DARWIN_OPENSSL_LIB_DIR=/usr/local/opt/openssl/lib" >> $GITHUB_ENV
- name: Install app dependencies and build web
run: |
yarn
cd ./gui-react
yarn
- name: Build the app (Linux)
if: startsWith(runner.os,'Linux')
continue-on-error: true
env:
CI: false
run: |
yarn run tauri build --target x86_64-unknown-linux-gnu
# yarn run tauri build --target aarch64-unknown-linux-gnu
- name: Build the app (macOS)
if: startsWith(runner.os,'macOS')
continue-on-error: true
env:
CI: false
run: |
yarn run tauri build --target x86_64-apple-darwin
yarn run tauri build --target aarch64-apple-darwin
yarn run tauri build --target universal-apple-darwin
- name: Prepare packages - ${{ matrix.platform }}
shell: bash
run: |
# /target/**/release/bundle/macos/tari-launchpad*.app
target_temp="${{ runner.temp }}/${{ matrix.platform }}"
mkdir -p "${target_temp}"
find "${{ github.workspace }}/target/" \( -iname "*.deb" -o -iname "*.AppImage" \
-o -iname "*.dmg" \) -exec cp -v {} ${target_temp} \;
cd "${target_temp}"
shasum -a 256 * >> "${{ matrix.platform }}.txt.sha256sums"
- name: Artifact upload - ${{ matrix.platform }}
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: tari-launchpad-${{ matrix.platform }}
path: ${{ runner.temp }}/${{ matrix.platform }}
create-draft-release:
# tag should match - backend/(package.json|tauri.conf.json) [package:version]
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
needs: builds
steps:
- name: Download build binaries
uses: actions/download-artifact@v3
with:
path: tari-launchpad
- name: Verify binaries with checksums
shell: bash
working-directory: tari-launchpad
run: |
mv -v tari-launchpad-*-latest/* .
find . -name "*-latest.txt.sha256sums" -print | xargs cat >> tari-launchpad.txt.sha256sums
sha256sum -c tari-launchpad.txt.sha256sums
- name: Create draft release
uses: ncipollo/release-action@v1
with:
artifacts: "tari-launchpad/tari-launchpad_*,tari-launchpad/tari-launchpad.txt.sha256sums"
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
draft: true
allowUpdates: true
updateOnlyUnreleased: true
replacesArtifacts: true