Skip to content

Unpublish Release

Unpublish Release #2

name: Unpublish Release
on:
release:
types: [deleted]
env:
NODE_VERSION: "18.15.0"
permissions:
contents: write
jobs:
unpublish_package:
name: Unpublish package
runs-on: ubuntu-20.04
if: github.event.release.tag_name != 'unreleased'
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
ref: main
lfs: false
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- name: Unpublish the NPM package
run: npm unpublish -f @mtrdesign/krait-ui@$VERSION
env:
VERSION: ${{ github.event.release.tag_name }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
delete_tag:
name: Delete release tag
runs-on: ubuntu-20.04
if: github.event.release.tag_name != 'unreleased'
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
ref: main
lfs: false
- name: Delete the tag
run: git push --delete origin $VERSION
env:
VERSION: ${{ github.event.release.tag_name }}