chore: Update CI workflow and package.json minimum engines

This commit is contained in:
Dexxiez 2023-12-29 19:39:35 +11:00
parent 1dc24222ca
commit 2f4dbf06a2
3 changed files with 94 additions and 85 deletions

View File

@ -7,55 +7,63 @@ on:
branches: ["main"]
jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20] # Current LTS versions
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
- name: Install Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 16
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-frozen-lockfile
- uses: actions/cache@v3
name: Setup pnpm cache
- 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:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
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
# - name: Lint
# run: pnpm lint
# - name: Run tests
# run: pnpm test
run: pnpm install --frozen-lockfile --prefer-frozen-lockfile
- name: Build asar
run: pnpm dist
- uses: actions/upload-artifact@v3
name: Upload artifact
# if: ${{ github.ref == 'refs/heads/main' }} # Only create artifacts when pushed to main
with:
name: betterdiscord.asar
path: dist/betterdiscord.asar

1
.npmrc Normal file
View File

@ -0,0 +1 @@
auto-install-peers=false # Maintain PNPM v7 behavior for now

View File

@ -30,7 +30,7 @@
"webpack-cli": "^4.10.0"
},
"engines": {
"node": ">=14",
"pnpm": ">=7"
"node": ">=18",
"pnpm": ">=8"
}
}