Skip to content

Unpublish RC Package #3

Unpublish RC Package

Unpublish RC Package #3

Workflow file for this run

name: Unpublish RC Package
on:
workflow_dispatch:
inputs:
version:
description: 'Version to unpublish (must contain rc, e.g., 1.0.0-rc.1)'
required: true
type: string
confirm_unpublish:
description: 'Type YES to confirm unpublishing'
required: true
default: ''
permissions:
id-token: write
jobs:
unpublish:
if: ${{ github.event.inputs.confirm_unpublish == 'YES' && contains(github.event.inputs.version, 'rc') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8.9.2
- name: Install dependencies
run: pnpm i
- name: Validate RC version
run: |
VERSION="${{ github.event.inputs.version }}"
if [[ ! "$VERSION" =~ rc ]]; then
echo "❌ Error: Cannot unpublish non-RC version ($VERSION)"
echo "Only RC versions (containing 'rc') can be unpublished"
exit 1
fi
echo "✅ Version $VERSION is valid for RC unpublishing"
- name: Audit Signatures
run: npm audit signatures
- name: Unpublish RC package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "Unpublishing libwiz@${{ github.event.inputs.version }}"
npm unpublish "libwiz@${{ github.event.inputs.version }}" --force
echo "✅ Successfully unpublished libwiz@${{ github.event.inputs.version }}"