Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added release action #84

Merged
merged 5 commits into from Sep 21, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/npm-publish.yml
@@ -0,0 +1,42 @@
name: Manual NPM Publish

on:
workflow_dispatch:
inputs:
releaseType:
description: 'Release type - major, minor or patch'
required: true
default: 'patch'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v2
- name: Setup Node version
uses: actions/setup-node@v1
with:
node-version: 10.15.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update the node version to latest LTS (including in .nvmrc)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this action (setup-node) doesn't support keywords like lts, see actions/setup-node#58. I can bump Node version to match current LTS, but until the PR is merged we will need to do it manually.

- name: Install dependencies
run: npm install
christian-bromann marked this conversation as resolved.
Show resolved Hide resolved
- name: Run tests
run: npm test
- name: Build package
run: npm run build

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v2
- name: Setup Node version
uses: actions/setup-node@v1
with:
node-version: 10.15.1
registry-url: https://registry.npmjs.org/
- name: Release
run: npm release:${{github.event.inputs.releaseType}}
christian-bromann marked this conversation as resolved.
Show resolved Hide resolved
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4 changes: 4 additions & 0 deletions package.json
Expand Up @@ -66,6 +66,7 @@
"eslint": "^4.7.2",
"eslint-plugin-import": "^2.8.0",
"jest": "^24.1.0",
"jest-snapshot-serializer-ansi": "^1.0.0",
"np": "^2.18.2",
"npm-run-all": "^4.1.5",
"rimraf": "^2.6.2",
Expand Down Expand Up @@ -93,6 +94,9 @@
],
"coveragePathIgnorePatterns": [
"src/scripts"
],
"snapshotSerializers": [
"jest-snapshot-serializer-ansi"
]
},
"dependencies": {
Expand Down