Skip to content

Commit

Permalink
feat: add release automation scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Oct 1, 2020
1 parent 303371f commit be42947
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: npm bump

on:
workflow_dispatch:
inputs:
newversion:
description: 'npm version {major,minor,patch}'
required: true

env:
node_version: 14

jobs:
version_and_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.2
with:
# fetch full history so things like auto-changelog work properly
fetch-depth: 012core@littlstar.com
- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v2.1.1
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
- uses: bcomnes/npm-bump@v2.0.1
with:
git_email: 12core@littlstar.com
git_username: ${{ github.actor }}
newversion: ${{ github.event.inputs.newversion }}
publish_cmd: npm run release # dont publish to a registry. set up something else in a different script
github_token: ${{ secrets.GITHUB_TOKEN }} # built in actions token. Passed tp gh-release if in use.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
tmp_modules
package-lock.json
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "index.js",
"scripts": {
"test": "standard",
"release": "git push --follow-tags && gh-release",
"release": "git push --follow-tags && gh-release -y",
"version": "npm run build && auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md dist",
"build": "rm -rf dist && ncc build index.js -o dist -s"
},
Expand Down

0 comments on commit be42947

Please sign in to comment.