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

Add npm publish workflow #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/bump-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Bump Version"

on:
push:
branches:
- "master"

jobs:
bump-version:
name: "Bump Version on master"
runs-on: ubuntu-latest

steps:
- name: "Checkout source code"
uses: "actions/checkout@v2"
with:
ref: ${{ github.ref }}

- name: "cat package.json"
run: cat ./package.json

- name: "Setup Node.js"
uses: "actions/setup-node@v1"
with:
node-version: 12

- name: "Automated Version Bump"
uses: "phips28/gh-action-bump-version@master"
with:
tag-prefix: ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "cat package.json"
run: cat ./package.json
36 changes: 36 additions & 0 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: publish

on:
release:
types: [published]

jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 10.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use node 12?


- name: Change directory to package
run: cd package

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build

- name: Publish to npm
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}

- if: steps.publish.type != 'none'
run: |
echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"