Merge branch 'build-constants' #443
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: | |
pull_request: | |
jobs: | |
format: | |
name: Check Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
cache: "npm" | |
- name: Install Node.js dependencies | |
run: npm ci | |
- name: Check formatting | |
run: npm run check-format | |
build: | |
strategy: | |
matrix: | |
host: | |
- { os: macos-latest, shortName: "mac", displayName: "macOS", artifactPath: "dist/AdvantageScope-*.dmg" } | |
- { | |
os: ubuntu-latest, | |
shortName: "linux", | |
displayName: "Linux", | |
artifactPath: "dist/*.deb\ndist/*.rpm\ndist/*.pacman" | |
} | |
- { | |
os: windows-latest, | |
shortName: "win", | |
displayName: "Windows", | |
artifactPath: "dist/AdvantageScope Setup *.exe" | |
} | |
arch: ["x64", "arm64"] | |
name: Build for ${{ matrix.host.displayName }} (${{ matrix.arch }}) | |
runs-on: ${{ matrix.host.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
cache: "npm" | |
- name: Install Node.js dependencies | |
run: npm ci | |
- name: Install Linux dependencies | |
if: matrix.host.os == 'ubuntu-latest' | |
run: sudo apt-get update; sudo apt-get install --no-install-recommends -y libarchive-tools | |
- name: Prepare macOS certificate | |
if: matrix.host.os == 'macos-latest' && github.event_name == 'push' | |
run: | | |
echo "CSC_LINK=${{ secrets.MACOS_CERTIFICATE }}" >> $GITHUB_ENV | |
echo "CSC_KEY_PASSWORD=${{ secrets.MACOS_CERTIFICATE_PWD }}" >> $GITHUB_ENV | |
- name: Build app | |
run: npm run build -- --${{ matrix.arch }} --publish never | |
env: | |
NODE_OPTIONS: --max-old-space-size=4096 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: advantagescope-${{ matrix.host.shortname }}-${{ matrix.arch }}-dev | |
path: ${{ matrix.host.artifactPath }} |