Build Artifacts #46
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
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy | |
# SPDX-License-Identifier: Apache-2.0 | |
# SPDX-License-Identifier: MIT | |
name: Build Artifacts | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/build-artifacts.yml' | |
- '**' | |
workflow_dispatch: | |
jobs: | |
build-artifacs: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-20.04, macos-latest, windows-latest] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: install libs (ubuntu only) | |
if: matrix.platform == 'ubuntu-20.04' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev libusb-1.0-0 libudev-dev | |
- name: Rust setup | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Rust cache | |
uses: swatinem/rust-cache@v2 | |
with: | |
workspaces: './src-tauri -> target' | |
- uses: pnpm/action-setup@v3 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: false | |
- name: Sync node version and setup cache | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'pnpm' # Set this to npm, yarn or pnpm. | |
- name: Install frontend dependencies | |
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too. | |
run: pnpm install --no-frozen-lockfile # Change this to npm, yarn or pnpm. | |
- name: build artifacts | |
if: matrix.platform != 'macos-latest' | |
working-directory: ./ | |
run: | | |
pnpm run tauri build | |
- name: build artifacts (MacOS) | |
if: matrix.platform == 'macos-latest' | |
working-directory: ./ | |
run: | | |
rustup target add aarch64-apple-darwin | |
rustup target add x86_64-apple-darwin | |
pnpm run tauri build --target universal-apple-darwin | |
- uses: actions/upload-artifact@v4 | |
if: matrix.platform == 'ubuntu-20.04' | |
with: | |
name: linux-deb | |
path: ./src-tauri/target/release/bundle/deb/*.deb | |
- uses: actions/upload-artifact@v4 | |
if: matrix.platform == 'ubuntu-20.04' | |
with: | |
name: linux-appimage | |
path: ./src-tauri/target/release/bundle/appimage/*.AppImage | |
- uses: actions/upload-artifact@v4 | |
if: matrix.platform == 'windows-latest' | |
with: | |
name: windows-exe | |
path: ./src-tauri/target/release/*.exe | |
- uses: actions/upload-artifact@v4 | |
if: matrix.platform == 'windows-latest' | |
with: | |
name: windows-msi | |
path: ./src-tauri/target/release/bundle/msi/* | |
- uses: actions/upload-artifact@v4 | |
if: matrix.platform == 'macos-latest' | |
with: | |
name: macos-app | |
path: ./src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app | |
- uses: actions/upload-artifact@v4 | |
if: matrix.platform == 'macos-latest' | |
with: | |
name: macos-dmg | |
path: ./src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg |