Skip to content

Commit 04d486f

Browse files
authored
Merge pull request #32 from unclamped/feat/pnpm
feat: migrate from npm to pnpm
2 parents 09ddd8b + cacfd77 commit 04d486f

11 files changed

+2045
-3138
lines changed

.github/dependabot.yml

-9
This file was deleted.

.github/workflows/ci.yml

+41-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,48 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
- push
5+
- pull_request
46

5-
jobs:
6-
build:
7+
env:
8+
CI: true
79

10+
jobs:
11+
cache-and-install:
812
runs-on: ubuntu-latest
913

10-
strategy:
11-
matrix:
12-
node-version: [16.x, 18.x]
13-
1414
steps:
15-
- uses: actions/checkout@v3
16-
- name: Use Node.js ${{ matrix.node-version }}
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: ${{ matrix.node-version }}
20-
- run: npm ci
21-
# - run: npm run build
22-
- run: npm test
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Install Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 16
22+
23+
- uses: pnpm/action-setup@v2
24+
name: Install pnpm
25+
id: pnpm-install
26+
with:
27+
version: 7
28+
run_install: false
29+
30+
- name: Get pnpm store directory
31+
id: pnpm-cache
32+
shell: bash
33+
run: |
34+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
35+
36+
- uses: actions/cache@v3
37+
name: Setup pnpm cache
38+
with:
39+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
40+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
41+
restore-keys: |
42+
${{ runner.os }}-pnpm-store-
43+
44+
- name: Install dependencies
45+
run: pnpm install
46+
47+
- name: Run test
48+
run: pnpm run test

.github/workflows/sbom.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: SBOM upload
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
jobs:
8+
SBOM-upload:
9+
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
contents: write
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Generate SBOM
18+
run: |
19+
curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64
20+
chmod +x $RUNNER_TEMP/sbom-tool
21+
$RUNNER_TEMP/sbom-tool generate -b . -bc . -pn ${{ github.repository }} -pv 1.0.0 -ps OwnerName -nsb https://sbom.mycompany.com -V Verbose
22+
- uses: actions/upload-artifact@v3
23+
with:
24+
name: sbom
25+
path: _manifest/spdx_2.2
26+
- name: SBOM upload
27+
uses: jhutchings1/[email protected]
28+
with:
29+
filePath: "_manifest/spdx_2.2/"

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
1. In `config.json`, configure the following values:
3030
- `account.username`: Your Minecraft account playername.
3131
- `proxy.whitelist`: Playernames of accounts that are allowed to connect to the proxy.
32-
2. Run `npm ci --omit=dev`
33-
3. Run `npm start`
32+
2. Run `pnpm i --prod`
33+
3. Run `pnpm start`
3434
4. Enter the auth code that appears in the console into microsoft.com/link
3535
5. Connect to `127.0.0.1` in Minecraft
3636
- If `127.0.0.1` doesn't work try `0.0.0.0`

0 commit comments

Comments
 (0)