Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keep-network/npm-version-bump
https://github.com/keep-network/npm-version-bump
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/keep-network/npm-version-bump
- Owner: keep-network
- License: mit
- Created: 2021-02-05T08:31:32.000Z (almost 4 years ago)
- Default Branch: v2
- Last Pushed: 2024-02-21T12:48:33.000Z (11 months ago)
- Last Synced: 2024-12-06T06:32:44.530Z (28 days ago)
- Language: JavaScript
- Size: 253 KB
- Stars: 0
- Watchers: 11
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NPM Package Version Bump Action
[![main](https://github.com/keep-network/npm-version-bump/actions/workflows/main.yml/badge.svg?branch=v2)](https://github.com/keep-network/npm-version-bump/actions/workflows/main.yml)
[![test](https://github.com/keep-network/npm-version-bump/actions/workflows/test.yml/badge.svg?branch=v2)](https://github.com/keep-network/npm-version-bump/actions/workflows/test.yml)This is a GitHub Action that bumps version of a NPM Package.
The version is formatted according to the pattern described in the [RFC-18]:
```
-.+.
```[RFC-18]:https://github.com/keep-network/keep-core/blob/master/docs/rfc/rfc-18-release-management.adoc#221-build-taggingpublishing
## Inputs
The action supports following input parameters:
- `work-dir` (optional, default: `.`) - location of `package.json` file,
- `is-prerelease` (optional, default: `true`) - defines if the version is a prerelease,
currently only `true` is supported,- `environment` (optional, default: `pre`) - prerelease id.
- `branch` (optional) - branch reference at which version is built
- `commit` (optional) - commit hash at which version is built
### Branch conversion
It's expected that `branch` parameter will be populated with [GitHub context `ref`
property](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context):> The branch or tag ref that triggered the workflow run. For branches this in the format refs/heads/, and for tags it is refs/tags/.
To handle this value correctly in the resulting version format the provided
value is converted in the following way:- `refs/heads/` and `refs/tag/` prefixes are stripped out,
- any `/` occurrence is replaced by `-`,
- any `.` occurrence is replaced with `-`.
## Usage
```yaml
- uses: keep-network/npm-version-bump@v2
with:
work-dir: ./contracts # optional, default: .
environment: "ropsten" # optional, default: pre
branch: ${{ github.ref }} # optional
commit: ${{ github.sha }} # optional
```## Outputs
The action outputs `version` property with a value of the resolved package version.
Example usage:
```yaml
- uses: keep-network/npm-version-bump@v2
id: bump-version
- name: Print resolved version
run: echo "Resolved new version ${{ steps.bump-version.outputs.version }}"
```