-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📦 NEW: workflow to publish npm package based on release tag (#709)
* 📦 NEW: workflow to publish npm package based on release tag * 👌 IMPROVE: remove publish flow
- Loading branch information
1 parent
2864035
commit 1502ca9
Showing
2 changed files
with
45 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Publish NPM Package | ||
on: | ||
release: | ||
types: | ||
- released | ||
|
||
jobs: | ||
publish: | ||
# check for version in the release tag - example: v1.0.0 | ||
if: contains(github.event.release.tag_name, '^v[0-9]+\.[0-9]+\.[0-9]') | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.14.2] | ||
|
||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
# TODO - find better approch to install the peer dependencies for local developement | ||
- name: Link lib | ||
run: npm link ./projects/password-strength-meter | ||
|
||
- name: Build - Lib | ||
run: npm run build:lib:prod | ||
|
||
- name: Get package version | ||
id: package-version | ||
uses: martinbeentjes/npm-get-version-action@master | ||
|
||
- name: Publish to npm | ||
run: npm publish dist/password-strength-meter/ | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters