-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.17 KB
/
unpublish-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 }}