Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Commit

Permalink
Update workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjdhjd committed Nov 22, 2020
1 parent 8b49bbc commit 656be8e
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 31 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Continuous integration - validate builds when commits are made, and publish when releases are created.
#
name: "Continuous Integration"

# Run the build on all push, pull request, and release creation events.
on:
pull_request:
push:
release:
types: [ created ]

jobs:

# Run a validation build on LTS versions of node.
validate-build:

# Build only if we've received a push event.
if: github.event_name == 'push'

# Create the build matrix for all the environments we're validating against.
strategy:
matrix:
node-version: [ 12.x, 14.x ]
os: [ ubuntu-latest ]

# Specify the environments we're going to build in.
runs-on: ${{ matrix.os }}

# Execute the build activities.
steps:
- name: Checkout the repository.
uses: actions/checkout@v2

- name: Setup the node ${{ matrix.node-version }} environment.
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}

- name: Build and install the package with a clean slate.
run: |
npm ci
npm run build --if-present
env:
CI: true

# Publish the release to the NPM registry.
publish-npm:

# Publish only if we've received a release event and the tag starts with "v" (aka v1.2.3).
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')

# Specify the environment we're going to build in.
runs-on: ubuntu-latest

# Execute the build and publish activities.
steps:
- name: Checkout the repository.
uses: actions/checkout@v2

- name: Setup the node environment.
uses: actions/[email protected]
with:

# Use the oldest node LTS version that we support.
node-version: '12.x'

# Use the NPM registry.
registry-url: 'https://registry.npmjs.org/'

- name: Install the package with a clean slate.
run: npm ci

- name: Publish the package to NPM.
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
31 changes: 0 additions & 31 deletions .github/workflows/npm-publish.yml

This file was deleted.

0 comments on commit 656be8e

Please sign in to comment.