chore: fix build script #21
Workflow file for this run
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: | |
tags: | |
- v** | |
jobs: | |
build-frontend: | |
name: Build snd-frontend | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
cache-dependency-path: frontend/package-lock.json | |
- name: Install Frontend Dependencies | |
working-directory: frontend | |
run: npm ci | |
- name: Build Frontend | |
working-directory: frontend | |
run: npm run build | |
- name: Archive Frontend | |
uses: actions/upload-artifact@v3 | |
with: | |
name: snd-frontend | |
path: frontend/dist | |
if-no-files-found: error | |
build-linux-app: | |
name: Build ${{ matrix.artifact-name }} | |
runs-on: ubuntu-latest | |
needs: build-frontend | |
strategy: | |
matrix: | |
include: | |
# ELECTRON | |
- arch: "amd64" | |
tags: "ELECTRON" | |
artifact-name: "snd-linux-amd64-gui" | |
- arch: "amd64" | |
libusb: true | |
tags: "ELECTRON LIBUSB" | |
artifact-name: "snd-linux-amd64-gui-libusb" | |
# HEADLESS | |
- arch: "amd64" | |
artifact-name: "snd-linux-amd64-headless" | |
- arch: "arm64" | |
artifact-name: "snd-linux-arm64-headless" | |
- arch: "386" | |
artifact-name: "snd-linux-i386-headless" | |
- arch: "arm" | |
armv: "5" | |
artifact-name: "snd-linux-armv5-headless" | |
- arch: "arm" | |
armv: "6" | |
artifact-name: "snd-linux-armv6-headless" | |
- arch: "arm" | |
armv: "7" | |
artifact-name: "snd-linux-armv7-headless" | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Install libusb | |
if: matrix.libusb | |
run: sudo apt-get install libusb-1.0-0-dev pkg-config && pkg-config --cflags libusb-1.0 | |
- name: Build App | |
uses: ./.github/actions/build-app | |
with: | |
os: linux | |
arch: ${{ matrix.arch }} | |
tags: ${{ matrix.tags }} | |
artifact-name: ${{ matrix.artifact-name }} | |
build-windows-app: | |
name: Build ${{ matrix.artifact-name }} | |
runs-on: windows-latest | |
needs: build-frontend | |
strategy: | |
matrix: | |
include: | |
# ELECTRON | |
- arch: "amd64" | |
libusb: false | |
tags: "ELECTRON" | |
artifact-name: "snd-windows" | |
- arch: "amd64" | |
libusb: true | |
tags: "ELECTRON LIBUSB" | |
artifact-name: "snd-windows-libusb" | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Prepare libusb | |
if: matrix.libusb | |
uses: msys2/setup-msys2@v2 | |
with: | |
path-type: inherit # needs access to other executables like go | |
install: git mingw-w64-x86_64-cc mingw-w64-x86_64-pkg-config mingw-w64-x86_64-libusb | |
- name: Check for libusb | |
if: matrix.libusb | |
shell: msys2 {0} | |
run: | | |
pkg-config --cflags libusb-1.0 | |
pkg-config --libs libusb-1.0 | |
ls D:/a/_temp/msys64/mingw64/bin/libusb-1.0.dll | |
- name: Build App | |
uses: ./.github/actions/build-app | |
with: | |
os: windows | |
arch: ${{ matrix.arch }} | |
tags: ${{ matrix.tags }} | |
artifact-name: ${{ matrix.artifact-name }} | |
libusb-path: ${{ matrix.libusb && 'D:/a/_temp/msys64/mingw64/bin/libusb-1.0.dll' || null }} | |
# macOS AMD64 | |
build-darwin-amd64-app: | |
name: Build ${{ matrix.artifact-name }} | |
runs-on: macos-12 | |
needs: build-frontend | |
strategy: | |
matrix: | |
include: | |
- arch: "amd64" | |
tags: "ELECTRON" | |
artifact-name: "snd-macos-intel" | |
mac-app-bundle: "true" | |
- arch: "amd64" | |
libusb: true | |
tags: "ELECTRON LIBUSB" | |
artifact-name: "snd-macos-intel-libusb" | |
mac-app-bundle: "true" | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Install libusb | |
if: matrix.libusb | |
run: brew install libusb pkg-config && pkg-config --cflags libusb-1.0 | |
- name: Build App | |
uses: ./.github/actions/build-app | |
with: | |
os: darwin | |
arch: ${{ matrix.arch }} | |
tags: ${{ matrix.tags }} | |
artifact-name: ${{ matrix.artifact-name }} | |
# macOS ARM64 (m1, m2, m3, mX) | |
build-darwin-arm64-app: | |
name: Build ${{ matrix.artifact-name }} | |
runs-on: macos-14 | |
needs: build-frontend | |
strategy: | |
matrix: | |
include: | |
- arch: "arm64" | |
tags: "ELECTRON" | |
artifact-name: "snd-macos-m1" | |
mac-app-bundle: "true" | |
- arch: "arm64" | |
libusb: true | |
tags: "ELECTRON LIBUSB" | |
artifact-name: "snd-macos-m1-libusb" | |
mac-app-bundle: "true" | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Install libusb | |
if: matrix.libusb | |
run: brew install libusb pkg-config && pkg-config --cflags libusb-1.0 | |
- name: Build App | |
uses: ./.github/actions/build-app | |
with: | |
os: darwin | |
arch: ${{ matrix.arch }} | |
tags: ${{ matrix.tags }} | |
artifact-name: ${{ matrix.artifact-name }} | |
create-release: | |
runs-on: ubuntu-latest | |
needs: [build-linux-app, build-windows-app, build-darwin-amd64-app, build-darwin-arm64-app] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: build/release | |
- name: Check release files | |
run: ls -hal build/release/ | |
- name: Zip release folders | |
run: cd build/release && { for i in */; do zip -r "${i%/}.zip" "$i"; done } | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
fail_on_unmatched_files: true | |
files: build/release/*.zip |