-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👷 Trigger publish-npm-package on tag push
- Loading branch information
1 parent
601c64a
commit d7a3c69
Showing
2 changed files
with
26 additions
and
20 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 |
---|---|---|
@@ -1,27 +1,33 @@ | ||
name: Publish package to npm | ||
|
||
on: | ||
release: | ||
types: [created] | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: 'https://npm.pkg.github.com' | ||
scope: '@zerogachis' | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: "https://npm.pkg.github.com" | ||
scope: "@zerogachis" | ||
|
||
- name: Update package version | ||
run: npm version --no-git-tag-version ${{ github.ref_name }} | ||
- name: Update package version | ||
run: npm version --no-git-tag-version ${{ github.ref_name }} | ||
|
||
- name: Publish | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Publish to npm | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
generate_release_notes: True |
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