Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 11 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,17 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.17.0
registry-url: 'https://registry.npmjs.org'
node-version: "22"
registry-url: "https://registry.npmjs.org"

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 10.12.2

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# npm 11.5.1 or later is required for trusted publishing
- name: Update npm
run: npm install -g npm@latest

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand All @@ -60,9 +51,7 @@ jobs:
run: pnpm run build

- name: Publish to NPM
run: pnpm publish --access public --no-git-checks --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --access public --no-git-checks

# ==========================================
# Job 2: Build binaries for all platforms
Expand All @@ -73,8 +62,8 @@ jobs:
# SECURITY: Only grant write permission where needed
permissions:
contents: write
attestations: write # SECURITY: For artifact attestation
id-token: write # SECURITY: For OIDC signing
attestations: write # SECURITY: For artifact attestation
id-token: write # SECURITY: For OIDC signing

strategy:
matrix:
Expand All @@ -99,7 +88,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: "22"

- name: Install pnpm
uses: pnpm/action-setup@v2
Expand Down Expand Up @@ -167,7 +156,7 @@ jobs:
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-path: 'shield-*'
subject-path: "shield-*"

- name: Upload binary and checksum to Release
uses: softprops/action-gh-release@v2
Expand All @@ -176,4 +165,4 @@ jobs:
shield-${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.platform == 'win32' && '.exe' || '' }}
shield-${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.platform == 'win32' && '.exe' || '' }}.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"license": "MIT",
"author": "Yield.xyz",
"publishConfig": {
"access": "public"
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"bin": {
"shield": "./dist/cli.js"
Expand Down
Loading