chore: Update CI workflow and package.json minimum engines
This commit is contained in:
parent
1dc24222ca
commit
2f4dbf06a2
|
@ -2,62 +2,70 @@ name: BetterDiscord CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: ["main"]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main" ]
|
branches: ["main"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
test:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [18, 20] # Current LTS versions
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
|
||||||
version: 7
|
|
||||||
run_install: false
|
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
- name: Install Node.js LTS
|
||||||
id: pnpm-cache
|
uses: actions/setup-node@v4
|
||||||
shell: bash
|
with:
|
||||||
run: |
|
node-version: ${{ matrix.node-version }}
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
cache: "pnpm"
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
- uses: pnpm/action-setup@v2
|
||||||
name: Setup pnpm cache
|
name: Install pnpm
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
version: 8
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
run_install: false
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile --prefer-frozen-lockfile
|
||||||
|
|
||||||
# - name: Lint
|
- name: Run tests
|
||||||
# run: pnpm lint
|
run: pnpm test
|
||||||
|
|
||||||
# - name: Run tests
|
- name: Ensure build compiles on Node.js ${{ matrix.node-version }} LTS
|
||||||
# run: pnpm test
|
run: pnpm dist
|
||||||
|
|
||||||
- name: Build asar
|
release:
|
||||||
run: pnpm dist
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.ref == 'refs/heads/main' }} # Only build when pushed to main
|
||||||
- uses: actions/upload-artifact@v3
|
steps:
|
||||||
name: Upload artifact
|
- name: Checkout
|
||||||
# if: ${{ github.ref == 'refs/heads/main' }} # Only create artifacts when pushed to main
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
name: betterdiscord.asar
|
- name: Install Node.js LTS
|
||||||
path: dist/betterdiscord.asar
|
uses: actions/setup-node@v4
|
||||||
retention-days: 30
|
with:
|
||||||
if-no-files-found: error
|
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
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
auto-install-peers=false # Maintain PNPM v7 behavior for now
|
68
package.json
68
package.json
|
@ -1,36 +1,36 @@
|
||||||
{
|
{
|
||||||
"name": "betterdiscord",
|
"name": "betterdiscord",
|
||||||
"version": "1.9.7",
|
"version": "1.9.7",
|
||||||
"description": "Enhances Discord by adding functionality and themes.",
|
"description": "Enhances Discord by adding functionality and themes.",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "pnpm run build-injector && pnpm run build-preload && pnpm run build-renderer",
|
"build": "pnpm run build-injector && pnpm run build-preload && pnpm run build-renderer",
|
||||||
"build-prod": "pnpm --filter injector build-prod && pnpm --filter preload build-prod && pnpm --filter renderer build-prod",
|
"build-prod": "pnpm --filter injector build-prod && pnpm --filter preload build-prod && pnpm --filter renderer build-prod",
|
||||||
"build-injector": "pnpm --filter injector build",
|
"build-injector": "pnpm --filter injector build",
|
||||||
"build-renderer": "pnpm --filter renderer build",
|
"build-renderer": "pnpm --filter renderer build",
|
||||||
"build-preload": "pnpm --filter preload build",
|
"build-preload": "pnpm --filter preload build",
|
||||||
"inject": "node scripts/inject.js",
|
"inject": "node scripts/inject.js",
|
||||||
"lint": "eslint --ext .js common/ && pnpm --filter injector lint && pnpm --filter preload lint && pnpm --filter renderer lint-js",
|
"lint": "eslint --ext .js common/ && pnpm --filter injector lint && pnpm --filter preload lint && pnpm --filter renderer lint-js",
|
||||||
"test": "mocha --require @babel/register --recursive \"./tests/renderer/*.js\"",
|
"test": "mocha --require @babel/register --recursive \"./tests/renderer/*.js\"",
|
||||||
"dist": "pnpm run build-prod && node scripts/pack.js",
|
"dist": "pnpm run build-prod && node scripts/pack.js",
|
||||||
"api": "jsdoc -X -r renderer/src/modules/api/ > jsdoc-ast.json",
|
"api": "jsdoc -X -r renderer/src/modules/api/ > jsdoc-ast.json",
|
||||||
"translations": "node -r dotenv/config scripts/translations.js"
|
"translations": "node -r dotenv/config scripts/translations.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.16.12",
|
"@babel/core": "^7.16.12",
|
||||||
"@babel/preset-env": "^7.16.11",
|
"@babel/preset-env": "^7.16.11",
|
||||||
"@babel/register": "^7.16.9",
|
"@babel/register": "^7.16.9",
|
||||||
"asar": "^3.2.0",
|
"asar": "^3.2.0",
|
||||||
"dotenv": "^16.0.3",
|
"dotenv": "^16.0.3",
|
||||||
"eslint": "^8.23.0",
|
"eslint": "^8.23.0",
|
||||||
"eslint-plugin-react": "^7.31.6",
|
"eslint-plugin-react": "^7.31.6",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"mocha": "^10.0.0",
|
"mocha": "^10.0.0",
|
||||||
"webpack": "^5.74.0",
|
"webpack": "^5.74.0",
|
||||||
"webpack-cli": "^4.10.0"
|
"webpack-cli": "^4.10.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14",
|
"node": ">=18",
|
||||||
"pnpm": ">=7"
|
"pnpm": ">=8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue