v1.0.0: rewrite of ui with typescript (#51) #9
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-usb" | |
# 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-amd64-gui" | |
- arch: "amd64" | |
libusb: true | |
tags: "ELECTRON LIBUSB" | |
artifact-name: "snd-windows-amd64-gui-usb" | |
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 }} | |
build-darwin-app: | |
name: Build ${{ matrix.artifact-name }} | |
runs-on: macos-latest | |
needs: build-frontend | |
strategy: | |
matrix: | |
include: | |
# ELECTRON | |
- arch: "amd64" | |
tags: "ELECTRON" | |
artifact-name: "snd-macos-amd64-gui" | |
- arch: "arm64" | |
tags: "ELECTRON" | |
artifact-name: "snd-macos-arm64-gui" | |
- arch: "amd64" | |
libusb: true | |
tags: "ELECTRON LIBUSB" | |
artifact-name: "snd-macos-amd64-gui-usb" | |
# Note: arm64 + USB not possible until we have an M1 runner | |
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-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 |