fix(actions): once again windows is special and different #423
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 | |
on: | |
push: | |
paths: | |
- '.github/workflows/build.yml' | |
- 'src-tauri/**/*' | |
- 'src/**/*' | |
- 'updater/**/*' | |
pull_request: | |
paths: | |
- '.github/workflows/build.yml' | |
- 'src-tauri/**/*' | |
- 'src/**/*' | |
- 'updater/**/*' | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
CARGO_INCREMENTAL: 0 | |
jobs: | |
build: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [windows-latest, ubuntu-latest, macos-latest] | |
steps: | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.6.7 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
src-tauri/target/ | |
updater/target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Linux dependencies | |
if: matrix.platform == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libwebkit2gtk-4.0-dev \ | |
build-essential \ | |
curl \ | |
wget \ | |
libssl-dev \ | |
libgtk-3-dev \ | |
libayatana-appindicator3-dev \ | |
librsvg2-dev | |
- name: Install MacOS universal target | |
if: matrix.platform == 'macos-latest' | |
run: rustup target add aarch64-apple-darwin | |
- name: Build updater | |
run: pnpm build:updater | |
- name: Install dependencies | |
run: pnpm install && pnpm shupdate | |
- name: Build | |
# Include --target universal-apple-darwin for MacOS, otherwise it will only build for x86_64 | |
run: pnpm prebuild && pnpm tauri build ${{ matrix.platform == 'macos-latest' && '--target universal-apple-darwin' || '' }} | |
# Make empty folders for plugins and themes | |
- name: Create empty folders for plugins and themes | |
if: matrix.platform == 'windows-latest' | |
run: if not exist src-tauri/target/release/plugins | |
mkdir src-tauri/target/release/plugins && | |
if not exist src-tauri/target/release/plugins | |
mkdir -p src-tauri/target/release/themes | |
# Empty folders, unix edition | |
- name: Create empty folders for plugins and themes | |
if: matrix.platform != 'windows-latest' | |
run: mkdir -p src-tauri/target/release/plugins && mkdir -p src-tauri/target/release/themes | |
- name: Create empty config.json | |
run: cd src-tauri/target/release && echo {} > config.json | |
# paths: | |
# Windows: | |
# - src-tauri/target/release/Dorion.exe|config.json|plugins|themes|injection|icons | |
# Ubuntu: | |
# - src-tauri/target/release/dorion|config.json|plugins|themes|injection|icons | |
# MacOS: | |
# - src-tauri/target/universal-apple-darwin/release/bundle/macos/Dorion.app | |
- name: Compress build (windows) | |
if: matrix.platform == 'windows-latest' | |
run: 7z a -tzip Dorion.zip | |
src-tauri/target/release/Dorion.exe | |
src-tauri/target/release/config.json | |
src-tauri/target/release/updater.exe | |
src-tauri/target/release/plugins/ | |
src-tauri/target/release/themes/ | |
src-tauri/target/release/icons/ | |
src-tauri/target/release/injection/ | |
- name: Compress build (linux) | |
if: matrix.platform == 'ubuntu-latest' | |
run: cd src-tauri/target/release && tar -czvf dorion.tar.gz dorion config.json updater ./plugins ./themes ./injection ./icons | |
# Windows portable | |
- name: Upload Windows portable | |
if: matrix.platform == 'windows-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dorion_win64_portable | |
path: Dorion.zip | |
# Windows MSI | |
- name: Upload .msi | |
if: matrix.platform == 'windows-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Dorion_win64_msi | |
path: src-tauri/target/release/bundle/msi/*.msi | |
# Ubuntu portable | |
- name: Upload Linux portable | |
if: matrix.platform == 'ubuntu-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dorion_amd64_portable | |
path: src-tauri/target/release/dorion.tar.gz | |
# Ubuntu deb | |
- name: Upload .deb | |
if: matrix.platform == 'ubuntu-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dorion_amd64_deb | |
path: src-tauri/target/release/bundle/deb/*.deb | |
- name: Upload Ubuntu .appimage | |
if: matrix.platform == 'ubuntu-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dorion_amd64_appimage | |
path: src-tauri/target/release/bundle/appimage/*.AppImage | |
- name: Upload .dmg | |
if: matrix.platform == 'macos-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dorion_macos_dmg | |
path: src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg | |
# build-arm: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Setup node | |
# uses: actions/setup-node@v1 | |
# with: | |
# node-version: 18 | |
# - name: Install Rust | |
# uses: actions-rs/toolchain@v1 | |
# with: | |
# toolchain: stable | |
# - name: Install Linux dependencies | |
# run: | | |
# sudo apt-get update | |
# sudo apt-get install -y build-essential \ | |
# curl \ | |
# wget \ | |
# libssl-dev \ | |
# libgtk-3-dev \ | |
# libayatana-appindicator3-dev \ | |
# librsvg2-dev \ | |
# gcc-aarch64-linux-gnu | |
# - name: Add arm64 jammy sources to sources.list | |
# run: sudo sh -c "echo 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse' >> /etc/apt/sources.list" | |
# - name: Install libwebkitgtk | |
# run: sudo apt update && sudo apt install libwebkit2gtk-4.0-dev:arm64 | |
# - name: Set PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/ | |
# run: export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/ | |
# - name: Install armv8 target | |
# run: rustup target add aarch64-unknown-linux-gnu | |
# - name: Install deps and build | |
# run: pnpm install && pnpm shupdate && pnpm prebuild && pnpm build && pnpm tauri build --target aarch64-unknown-linux-gnu | |
# - name: Create empty folders for plugins and themes for armv8 | |
# run: mkdir src-tauri/target/aarch64-unknown-linux-gnu/release/plugins && mkdir src-tauri/target/aarch64-unknown-linux-gnu/release/themes | |
# - name: Create empty config.json for armv8 | |
# run: cd src-tauri/target/aarch64-unknown-linux-gnu/release && touch config.json | |
# - name: Compress build for armv8 | |
# run: cd src-tauri/target/aarch64-unknown-linux-gnu/release && tar -czvf dorion_armv8.tar.gz dorion config.json ./plugins ./themes ./injection ./icons | |
# - name: Upload Linux portable for armv8 | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: Dorion_armv8_portable.tar.gz | |
# path: src-tauri/target/aarch64-unknown-linux-gnu/release/dorion_armv8.tar.gz | |
# - name: Upload Linux deb for armv8 | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: Dorion_armv8_deb.tar.gz | |
# path: src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/deb/*.deb |