forked from wickedest/Mergely
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Jamie Peabody
committed
Nov 21, 2021
1 parent
623a93b
commit addc610
Showing
3 changed files
with
121 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Publish to npm | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'NPM Tag' | ||
required: false | ||
default: 'next' | ||
|
||
jobs: | ||
tag-and-publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 10 | ||
registry-url: https://registry.npmjs.org | ||
|
||
- name: Git checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
env: | ||
CI: true | ||
|
||
- name: Get package version | ||
run: | | ||
export VERSION=`cat package.json | grep version | sed -E 's/.*: "(.*)",/\1/'` | ||
echo "DIST_TAG=v$VERSION" >> $GITHUB_ENV | ||
- name: Build | ||
run: npm test | ||
|
||
- name: Tag repo with $DIST_TAG | ||
run: | | ||
git tag $DIST_TAG | ||
git push origin $DIST_TAG | ||
- name: Publish to npm with dist-tag next | ||
run: npm publish --access public --tag ${{ github.event.inputs.tag }} | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Release latest on npm | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
|
||
jobs: | ||
tag-and-publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 10 | ||
registry-url: https://registry.npmjs.org | ||
|
||
- name: Git checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get package version | ||
run: | | ||
export VERSION=`cat package.json | grep version | sed -E 's/.*: "(.*)",/\1/'` | ||
echo "PKG_VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Update dist-tag | ||
run: npm dist-tag add mergely@${PKG_VERSION} latest | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Remove 'next' dist-tag | ||
run: npm dist-tag rm mergely next | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Run tests | ||
|
||
# on: [push, pull_request] | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'master' | ||
tags-ignore: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [14.x] #, 12.x, 14.x, 15.x | ||
|
||
name: Node.js ${{ matrix.node-version }} | ||
|
||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
env: | ||
CI: true | ||
|
||
- name: Test | ||
run: npm run test | ||
|
||
- name: Build | ||
run: npm run build:dist |