Skip to content

Commit

Permalink
Switched to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jcailan committed Mar 18, 2021
1 parent 156c91c commit e3e3b6f
Show file tree
Hide file tree
Showing 4 changed files with 2,195 additions and 6 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: NPM publish workflow

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout current release
uses: actions/checkout@v2
with:
ref: ${{ github.event.release.target_commitish }}

- name: Install NodeJs 12.x
uses: actions/setup-node@v1
with:
node-version: "12.x"

- name: Cache dependencies and build outputs to improve workflow execution time
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-js-${{ hashFiles('package-lock.json') }}

- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test

- name: Bump NPM version
run: npm version ${{ github.event.release.tag_name }}

- name: Set NPM Token
run: npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}"

- name: Publish to NPM
run: npm publish --tag ${{ github.event.release.target_commitish }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Push the version changes to GitHub
run: git push
env:
github-token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

0 comments on commit e3e3b6f

Please sign in to comment.