Build and Publish #106
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
name: Build and Publish | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
publish-tauri: | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: 'macos-latest' | |
arch: 'x64' | |
flag: '' | |
- platform: 'macos-latest' | |
arch: 'arm64' | |
flag: '--target aarch64-apple-darwin' | |
- platform: 'windows-latest' | |
arch: 'x64' | |
flag: '' | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: webfactory/ssh-agent | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Install dependencies | |
run: yarn | |
- uses: rui314/setup-mold@v1 | |
with: | |
make-default: false | |
- name: Install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: install dependencies (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 libappindicator3-dev librsvg2-dev patchelf | |
- name: install dependencies (m1 only) | |
if: matrix.platform == 'macos-latest' && matrix.arch == 'arm64' | |
run: | | |
rustup target add aarch64-apple-darwin | |
- name: Install frontend dependencies | |
run: yarn svelte:build | |
- name: Download FFmpeg (ubuntu) | |
if: matrix.platform == 'ubuntu-20.04' | |
run: | | |
curl https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz -o ffmpeg.tar.xz | |
tar -xf ffmpeg.tar.xz | |
mv ffmpeg-git-*/ffmpeg src-tauri/bin/ffmpeg-x86_64-unknown-linux-gnu | |
- name: Download FFmpeg (osx) | |
if: matrix.platform == 'macos-latest' && matrix.arch == 'x64' | |
run: | | |
curl -L https://evermeet.cx/ffmpeg/get/zip -o ffmpeg.zip | |
unzip ffmpeg.zip -d src-tauri/bin/ | |
mv src-tauri/bin/ffmpeg src-tauri/bin/ffmpeg-x86_64-apple-darwin | |
- name: Download FFmpeg (m1) | |
if: matrix.platform == 'macos-latest' && matrix.arch == 'arm64' | |
run: | | |
curl -L https://evermeet.cx/ffmpeg/get/zip -o ffmpeg.zip | |
unzip ffmpeg.zip -d src-tauri/bin/ | |
mv src-tauri/bin/ffmpeg src-tauri/bin/ffmpeg-aarch64-apple-darwin | |
- name: Download FFmpeg (windows) | |
if: matrix.platform == 'windows-latest' | |
run: | | |
curl -L https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z -o ffmpeg.7z | |
7z x ffmpeg.7z | |
mv ffmpeg-*-git-*/bin/ffmpeg.exe src-tauri/bin/ffmpeg-x86_64-pc-windows-msvc.exe | |
- uses: tauri-apps/tauri-action@dev | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
with: | |
tagName: __VERSION__v | |
releaseName: 'Layendanimator v__VERSION__' | |
releaseBody: 'See the assets to download this version and install.' | |
releaseDraft: false | |
prerelease: false | |
updaterJsonPreferNsis: true | |
args: ${{ matrix.flag }} |