Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lvjiaxuan/release-action
GitHub action to create a release on tag push
https://github.com/lvjiaxuan/release-action
Last synced: about 1 month ago
JSON representation
GitHub action to create a release on tag push
- Host: GitHub
- URL: https://github.com/lvjiaxuan/release-action
- Owner: lvjiaxuan
- License: mit
- Created: 2022-06-01T11:14:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-17T08:40:15.000Z (almost 2 years ago)
- Last Synced: 2024-10-18T20:41:04.929Z (3 months ago)
- Language: TypeScript
- Homepage:
- Size: 927 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# release-action
[Create a release](https://docs.github.com/en/rest/releases/releases#create-a-release) through GitHub Action.
Update when the tagName's release has already created.
## Inputs
[action.yml](./action.yml).
## Example Usage
*.github/workflows/release-ci.yml*:
```yml
name: Create a releaseon:
push:
tags:
- v*jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: lvjiaxuan/release-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```> [`secrets.GITHUB_TOKEN` is created automatically](https://docs.github.com/cn/actions/security-guides/automatic-token-authentication)
## [Node.js packages publish](https://docs.github.com/cn/actions/publishing-packages/publishing-nodejs-packages)
### 1. Specify `registry-url` of *actions/setup-node*'s inputs for generating *.npmrc* file.
```yml
- uses: actions/setup-node@v2
with:
node-version: 16 # ${{ matrix.node }}
# .npmrc file for authentication would be generated
# https://npm.pkg.github.com(env.NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }})
registry-url: https://registry.npmjs.org
cache: npm
```> [Refer](https://github.com/actions/setup-node/issues/82#issuecomment-970324194): *.npmrc* file has more priority than `publshConfig` of package.json, so it will override properties.
### 2. Specify NPM Token for `npm publish`
1. Create your own npm token first(refer to https://www.npmjs.com/settings/{yourname}/tokens)
1. Set it to GitHub Repo: [repo] -> settings -> secrets```yml
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
```