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: | ||
name: build and release electron app | ||
runs-on: '${{ matrix.os }}' | ||
strategy: | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-latest] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
- name: Install Dependencies | ||
run: pnpm install | ||
- name: Build Electron App | ||
run: 'pnpm run build:desktop' | ||
env: | ||
GITHUB_TOKEN: '${{ secrets.ACCESS_TOKEN }}' | ||
- name: Cleanup Artifacts for Windows | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
npx rimraf "packages/desktop/release/!(*.exe)" | ||
- name: Cleanup Artifacts for MacOS | ||
if: matrix.os == 'macos-latest' | ||
run: | | ||
npx rimraf "packages/desktop/release/!(*.dmg)" | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: '${{ matrix.os }}' | ||
path: packages/desktop/release | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
if: "startsWith(github.ref, 'refs/tags/')" | ||
with: | ||
files: packages/desktop/release/** | ||
env: | ||
GITHUB_TOKEN: '${{ secrets.ACCESS_TOKEN }}' |