Skip to content

Commit 356041c

Browse files
committed
ci: migrate workflows from pnpm to npm for dependency management and script execution
1 parent ad38bd3 commit 356041c

2 files changed

Lines changed: 24 additions & 26 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,31 @@ jobs:
1515
uses: actions/setup-node@v4
1616
with:
1717
node-version-file: .nvmrc
18-
cache: 'pnpm'
19-
20-
- name: Setup pnpm
21-
uses: pnpm/action-setup@v4
22-
with:
23-
version: 10
18+
cache: 'npm'
2419

2520
- name: Install dependencies
26-
run: pnpm install --frozen-lockfile
21+
run: |
22+
if [ -f package-lock.json ]; then
23+
npm ci --no-audit --no-fund
24+
else
25+
npm install --no-audit --no-fund
26+
fi
2727
2828
- name: Lint
29-
run: pnpm run lint
29+
run: npm run lint
3030

3131
- name: Build
32-
run: pnpm run build
32+
run: npm run build
3333
env:
3434
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
3535
APPLICATION_ID: ${{ secrets.APPLICATION_ID }}
3636

3737
- name: Run tests
38-
run: pnpm run test
38+
run: npm test
3939

4040
- name: Package artifact
4141
run: |
42-
tar -czf release.tar.gz dist package.json pnpm-lock.yaml .nvmrc
42+
tar -czf release.tar.gz dist package.json package-lock.json .nvmrc || tar -czf release.tar.gz dist package.json .nvmrc
4343
4444
- name: Create .env file from secrets
4545
env:
@@ -102,12 +102,10 @@ jobs:
102102
set -a
103103
if [ -f "$APP_DIR/shared/.env" ]; then . "$APP_DIR/shared/.env"; fi
104104
set +a
105-
if command -v pnpm >/dev/null 2>&1; then
106-
pnpm install --prod --frozen-lockfile || true
105+
if [ -f package-lock.json ]; then
106+
npm ci --omit=dev --no-audit --no-fund || true
107107
else
108-
if command -v corepack >/dev/null 2>&1; then corepack enable; fi
109-
npm i -g pnpm@10 || true
110-
pnpm install --prod --frozen-lockfile || true
108+
npm install --omit=dev --no-audit --no-fund || true
111109
fi
112110
pm2 describe webdev-bot >/dev/null 2>&1 && pm2 restart webdev-bot || pm2 start "node dist/index.js" --name webdev-bot
113111
pm2 save || true

.github/workflows/test.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ jobs:
1515
uses: actions/setup-node@v4
1616
with:
1717
node-version-file: .nvmrc
18-
cache: 'pnpm'
19-
20-
- name: Setup pnpm
21-
uses: pnpm/action-setup@v4
22-
with:
23-
version: 10
18+
cache: 'npm'
2419

2520
- name: Install dependencies
26-
run: pnpm install --frozen-lockfile
21+
run: |
22+
if [ -f package-lock.json ]; then
23+
npm ci --no-audit --no-fund
24+
else
25+
npm install --no-audit --no-fund
26+
fi
2727
2828
- name: Lint
29-
run: pnpm run lint
29+
run: npm run lint
3030

3131
- name: Build
32-
run: pnpm run build
32+
run: npm run build
3333
env:
3434
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
3535
APPLICATION_ID: ${{ secrets.APPLICATION_ID }}
3636

3737
- name: Run tests
38-
run: pnpm run test
38+
run: npm test
3939

0 commit comments

Comments
 (0)