Skip to content

Commit

Permalink
Simplify NPM release script (just run when release is created manuall…
Browse files Browse the repository at this point in the history
…y in GitHub)
  • Loading branch information
doubleedesign committed Sep 29, 2024
1 parent 83951ed commit 5dcafb1
Showing 1 changed file with 4 additions and 28 deletions.
32 changes: 4 additions & 28 deletions .github/workflows/release-and-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Publish component library to NPM

on:
push:
branches:
- main
release:
types: [created]

jobs:
test:
Expand All @@ -27,30 +26,8 @@ jobs:
- run: npm ci
- run: npm run package

release:
needs: build
runs-on: ubuntu-latest
outputs:
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- name: Semantic Release
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

publish:
needs: release
if: needs.release.outputs.new_release_published == 'true'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -59,7 +36,6 @@ jobs:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm version ${{ needs.release.outputs.new_release_version }} --no-git-tag-version
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 comments on commit 5dcafb1

Please sign in to comment.