Release v2.0.0-alpha2 #2
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: Compile Rust Library | |
on: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
branches: [ "*" ] | |
jobs: | |
build: | |
name: Build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-latest, windows-latest ] | |
include: | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
targets: ${{ matrix.target }} | |
- name: Run Cargo Test | |
run: cargo test --target ${{ matrix.target }} | |
shell: bash | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'latest' | |
- name: Install dependencies | |
run: npm ci --include=dev | |
- name: Build for ${{ matrix.os }} | |
env: | |
GH_TOKEN: ${{ secrets.github_token }} | |
run: | | |
if [ "${{ matrix.os }}" == "macos-latest" ]; then | |
npm run release:mac | |
else | |
npm run release:win | |
fi | |
shell: bash | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: scarlet-${{ matrix.os }} | |
path: | | |
dist/*.dmg | |
dist/*.exe | |
dist/*.zip | |
if-no-files-found: error | |
- name: Build/release Electron app | |
uses: samuelmeuli/action-electron-builder@v1 | |
with: | |
# GitHub token, automatically provided to the action | |
# (No need to define this secret in the repo settings) | |
github_token: ${{ secrets.github_token }} | |
# If the commit is tagged with a version (e.g. "v1.0.0"), | |
# release the app after building | |
release: ${{ startsWith(github.ref, 'refs/tags/v') }} |