-
Notifications
You must be signed in to change notification settings - Fork 504
173 lines (152 loc) · 6.09 KB
/
release-app.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
# # Run for macOS
# act -W .github/workflows/release-app.yml --container-architecture linux/amd64 -j publish-tauri -P macos-latest=-self-hosted
# # Run for Linux
# act -W .github/workflows/release-app.yml --container-architecture linux/amd64 -j publish-tauri -P ubuntu-24.04
# Manual release instructions for Mac:
# VERSION=app-0.1.0
# git tag $VERSION
# git push origin $VERSION
# gh release create $VERSION --generate-notes
# export TAURI_SIGNING_PRIVATE_KEY="..."
# export TAURI_SIGNING_PRIVATE_KEY_PASSWORD="..."
# export PKG_CONFIG_PATH="/usr/local/opt/ffmpeg/lib/pkgconfig:$PKG_CONFIG_PATH"
# export PKG_CONFIG_ALLOW_CROSS=1
# For M1 (aarch64-apple-darwin):
# cargo build --release --features metal --target aarch64-apple-darwin
# cd examples/apps/screenpipe-app-tauri
# bun scripts/pre_build.js
# bun tauri build --target aarch64-apple-darwin -- --features metal
# tar -czf screenpipe-${VERSION}-aarch64-apple-darwin.tar.gz -C ../target/aarch64-apple-darwin/release/bundle/dmg screenpipe_0.1.0_aarch64.dmg
# gh release upload ${VERSION} screenpipe-${VERSION}-aarch64-apple-darwin.tar.gz
# rm screenpipe-${VERSION}-aarch64-apple-darwin.tar.gz
#
# For Intel (x86_64-apple-darwin):
# cd ../../..
# cargo build --release --features metal --target x86_64-apple-darwin
# cd examples/apps/screenpipe-app-tauri
# bun scripts/pre_build.js
# bun tauri build --target x86_64-apple-darwin -- --features metal
# tar -czf screenpipe-${VERSION}-x86_64-apple-darwin.tar.gz -C ../target/x86_64-apple-darwin/release/bundle/dmg screenpipe_0.1.0_x64.dmg
# gh release upload ${VERSION} screenpipe-${VERSION}-x86_64-apple-darwin.tar.gz
# rm screenpipe-${VERSION}-x86_64-apple-darwin.tar.gz
#
name: Release App
on:
# push:
# tags:
# - "v*"
workflow_dispatch:
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
# - platform: "macos-latest" # for Arm based macs (M1 and above).
# args: "--target aarch64-apple-darwin --features metal"
# target: aarch64-apple-darwin
# - platform: "macos-latest" # for Intel based macs.
# args: "--target x86_64-apple-darwin --features metal"
# target: x86_64-apple-darwin
# - platform: "ubuntu-24.04" # Ubuntu x86_64 # TODO focus on mac atm
# args: "" # TODO CUDA
- platform: "windows-latest" # Windows x86_64
args: "--target x86_64-pc-windows-msvc" # TODO CUDA? --features "openblas"
pre-build-args: "" # --openblas
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: setup Bun
uses: oven-sh/setup-bun@v1
- name: Rust cache
uses: swatinem/rust-cache@v2
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Cache Homebrew packages
if: matrix.platform == 'macos-latest'
uses: actions/cache@v3
with:
path: |
~/Library/Caches/Homebrew
/usr/local/Cellar/ffmpeg
/usr/local/Cellar/pkg-config
key: ${{ runner.os }}-brew-${{ hashFiles('.github/workflows/release-cli.yml') }}
restore-keys: |
${{ runner.os }}-brew-
- name: Cache Pre Build
id: cache-pre-build
uses: actions/cache@v4
with:
path: |
examples/apps/screenpipe-app-tauri/src-tauri/openblas
examples/apps/screenpipe-app-tauri/src-tauri/clblast
examples/apps/screenpipe-app-tauri/src-tauri/ffmpeg
examples/apps/screenpipe-app-tauri/src-tauri/tesseract-*
key: ${{ matrix.platform }}-${{ matrix.args }}-pre-build
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.platform }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-24.04'
run: |
sudo apt-get update
sudo apt-get install -y libappindicator3-1 libappindicator3-dev
- name: Install dependencies
if: matrix.platform == 'macos-latest'
run: |
brew install ffmpeg pkg-config
- name: Install frontend dependencies
shell: bash
working-directory: ./examples/apps/screenpipe-app-tauri
run: |
ls .
bun install
# Run pre build
- name: Run pre_build.js on ${{ matrix.platform }}
shell: bash
run: bun ./scripts/pre_build.js ${{ matrix.pre-build-args }}
working-directory: ./examples/apps/screenpipe-app-tauri
- name: Build CLI
shell: bash
run: |
if [[ "${{ matrix.platform }}" == "macos-latest" ]]; then
export PKG_CONFIG_PATH="/usr/local/opt/ffmpeg/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_ALLOW_CROSS=1
fi
cargo build --release ${{ matrix.args }}
ls -R target
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# Run pre build again to copy the CLI into app
- name: Run pre_build.js on ${{ matrix.platform }}
shell: bash
run: bun ./scripts/pre_build.js ${{ matrix.pre-build-args }}
working-directory: ./examples/apps/screenpipe-app-tauri
- name: Build
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
tagName: v__VERSION__ # the action automatically replaces __VERSION__ with the app version.
releaseName: "v__VERSION__"
releaseBody: "What's new? 🎉📣"
releaseDraft: true
prerelease: true
args: ${{ matrix.args }}
projectPath: "./examples/apps/screenpipe-app-tauri"
tauriScript: bunx tauri -v