72 lines
1.6 KiB
YAML
72 lines
1.6 KiB
YAML
name: BetterDiscord CI
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [18, 20] # Current LTS versions
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Node.js LTS
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: "pnpm"
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
name: Install pnpm
|
|
with:
|
|
version: 8
|
|
run_install: false
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile --prefer-frozen-lockfile
|
|
|
|
- name: Run tests
|
|
run: pnpm test
|
|
|
|
- name: Ensure build compiles on Node.js ${{ matrix.node-version }} LTS
|
|
run: pnpm dist
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.ref == 'refs/heads/main' }} # Only build when pushed to main
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Node.js LTS
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: "pnpm"
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
name: Install pnpm
|
|
with:
|
|
version: 8
|
|
run_install: false
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile --prefer-frozen-lockfile
|
|
|
|
- name: Build asar
|
|
run: pnpm dist
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
name: Upload artifact
|
|
with:
|
|
name: betterdiscord.asar
|
|
path: dist/betterdiscord.asar
|
|
retention-days: 30
|
|
if-no-files-found: error
|