This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
38 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,33 @@ | ||
name: CI | ||
on: [push] | ||
jobs: | ||
build: | ||
name: Build and lint on Node ${{ matrix.node }} and ${{ matrix.os }} | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
check: | ||
name: Check on Node ${{ matrix.node }} and ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
node: ['14.x'] | ||
node: ['18.x'] | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node ${{ matrix.node }} | ||
uses: actions/setup-node@v2 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install deps and build (with cache) | ||
- name: Install deps | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: Lint && Build | ||
run: yarn build | ||
- name: Lint | ||
run: yarn lint | ||
|
||
- name: Test | ||
run: yarn test | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,38 @@ | ||
name: Publish | ||
on: | ||
workflow_dispatch: | ||
branches: [ master ] | ||
inputs: | ||
agreement: | ||
description: "Run manually?" | ||
type: choice | ||
options: | ||
- "yes" | ||
- "no" | ||
default: "no" | ||
required: true | ||
|
||
workflow_run: | ||
workflows: [ "CI" ] | ||
branches: [ master ] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
build: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
publish: | ||
if: | | ||
github.event.inputs.agreement == 'yes' || | ||
github.event.workflow_run.conclusion == 'success' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Setup .npmrc file to publish to npm | ||
- uses: actions/setup-node@v2 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
# Defaults to the user or organization that owns the workflow file | ||
scope: '@garvae' | ||
- run: yarn | ||
- run: yarn publish:dist | ||
- run: yarn publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters