Release App #183
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# # 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-22.04 | |
name: Release App | |
on: | |
# push: | |
# tags: | |
# - "v*" | |
workflow_dispatch: | |
jobs: | |
draft: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: create draft release | |
uses: crabnebula-dev/[email protected] | |
with: | |
command: release draft ${{ secrets.CN_APP_SLUG }} --framework tauri | |
api-key: ${{ secrets.CN_API_KEY }} | |
publish-tauri: | |
needs: draft | |
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-22.04" # Ubuntu x86_64 | |
args: "" # TODO CUDA | |
- platform: "windows-latest" # Windows x86_64 | |
args: "--target x86_64-pc-windows-msvc" # TODO CUDA? --features "openblas" | |
pre-build-args: "" # --openblas | |
# windows arm: https://github.com/ahqsoftwares/tauri-ahq-store/blob/2fbc2103c222662b3c6ee0cd71fcde664824f0ef/.github/workflows/publish.yml#L136 | |
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 }} | |
- uses: actions/cache@v3 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/bun.lockb') }} | |
- 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') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Install Linux dependencies | |
if: matrix.platform == 'ubuntu-22.04' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libappindicator3-1 libappindicator3-dev libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
- 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 | |
env: | |
SKIP_SCREENPIPE_SETUP: true # avoid trying to copy screenpipe binaries, not yet built (next step) | |
run: | | |
bun ./scripts/pre_build.js ${{ matrix.pre-build-args }} | |
ls -R . | |
working-directory: ./examples/apps/screenpipe-app-tauri | |
- name: Verify Tesseract Installation | |
if: matrix.platform == 'windows-latest' | |
shell: pwsh | |
run: | | |
$env:PATH += ";${{ github.workspace }}\examples\apps\screenpipe-app-tauri\src-tauri\tesseract" | |
tesseract --version | |
if ($LASTEXITCODE -ne 0) { | |
Write-Error "Tesseract is not properly installed or not in PATH" | |
exit 1 | |
} | |
- 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 | |
export RUSTFLAGS="-C link-arg=-Wl,-rpath,@executable_path/../Frameworks -C link-arg=-Wl,-rpath,@loader_path/../Frameworks -C link-arg=-Wl,-install_name,@rpath/libscreenpipe.dylib" | |
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 | |
- name: Upload Assets to CrabNebula Cloud | |
uses: crabnebula-dev/[email protected] | |
with: | |
command: release upload ${{ secrets.CN_APP_SLUG }} --framework tauri | |
api-key: ${{ secrets.CN_API_KEY }} | |
path: ./examples/apps/screenpipe-app-tauri/src-tauri | |
# basically wait for macos manual add sset | |
#publish: | |
# needs: publish-tauri | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: publish release | |
# uses: crabnebula-dev/[email protected] | |
# with: | |
# command: release publish ${{ secrets.CN_APP_SLUG }} --framework tauri | |
# api-key: ${{ secrets.CN_API_KEY }} |