Skip to content

Commit

Permalink
Add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Feb 21, 2023
1 parent d3bffc3 commit c09abba
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: npm bump

on:
workflow_dispatch:
inputs:
newversion:
description: 'npm version (major minor patch)'
required: true

env:
node_version: 'lts/*'
FORCE_COLOR: 1

concurrency: # prevent concurrent releases
group: npm-bump
cancel-in-progress: true

jobs:
version_and_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# fetch full history so things like auto-changelog work properly
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
registry-url: 'https://registry.npmjs.org'
- run: npm i
- run: npm test
- uses: bcomnes/npm-bump@v2.1.0
with:
git_email: bcomnes@gmail.com
git_username: ${{ github.actor }}
newversion: ${{ github.event.inputs.newversion }}
github_token: ${{ secrets.GITHUB_TOKEN }} # built in actions token. Passed tp gh-release if in use.
publish_cmd: npm run release
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "standard .",
"release": "git push --follow-tags && gh-release",
"release": "git push --follow-tags && gh-release -y",
"version": "auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md"
},
"repository": {
Expand Down

0 comments on commit c09abba

Please sign in to comment.