Skip to content

Commit

Permalink
fix: release & unpublish
Browse files Browse the repository at this point in the history
  • Loading branch information
tsi committed Dec 31, 2023
1 parent 38442c3 commit 03932d5
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 30 deletions.
21 changes: 0 additions & 21 deletions .github/actions/publish/action.yml

This file was deleted.

17 changes: 12 additions & 5 deletions .github/workflows/release-edge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Edge 🚀
name: 🌱 Release Edge

on:
push:
Expand Down Expand Up @@ -35,12 +35,19 @@ jobs:
release-type: node
release-as: ${{ steps.calculate-edge-version.outputs.next-edge }}

- name: Publish
uses: ./.github/actions/publish
# The logic below handles the npm publication:
- uses: actions/setup-node@v4
with:
tag: edge
node-version: '20.x'
if: ${{ steps.release.outputs.release_created }}
# these if statements ensure that a publication only occurs when
# a new release is created:
- run: npm run build-all
if: ${{ steps.release.outputs.release_created }}
- run: npm publish --tag edge
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
# ^^ publish only when a new release is created

# notify:
# runs-on: ubuntu-latest
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release 🚀
name: 🚀 Release

on:
push:
Expand All @@ -16,10 +16,23 @@ jobs:
with:
release-type: node

- name: Publish
uses: ./.github/actions/publish
# The logic below handles the npm publication:
- uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v4
with:
node-version: '20.x'
if: ${{ steps.release.outputs.release_created }}
- run: npm ci
if: ${{ steps.release.outputs.release_created }}
- run: npm run build-all
if: ${{ steps.release.outputs.release_created }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
# ^^ publish only when a new release is created

# notify:
# runs-on: ubuntu-latest
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/unpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: ⛔ Unpublish

on:
workflow_dispatch:
inputs:
version:
description: 'Version to unpublish'
required: true

jobs:
unpublish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Unpublish faulty version
run: npm unpublish cloudinary-video-player@${{ github.event.inputs.version }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 03932d5

Please sign in to comment.