-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(github): migrate travis ci/cd to gh actions - I4 (#352)
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
- Loading branch information
1 parent
86f30a5
commit 12aa266
Showing
43 changed files
with
207 additions
and
763 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,94 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
unit-tests: | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
|
||
name: Unit Tests | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
outputs: | ||
job-status: ${{ job.status }} | ||
|
||
steps: | ||
- name: git checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: lerna install | ||
run: | | ||
npm install lerna@^3.22.0 | ||
npm install | ||
- name: run unit tests | ||
run: | | ||
npm run test | ||
- name: Calculate code coverage | ||
run: | | ||
npm run coverage | ||
- name: Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
flag-name: ${{matrix.os}} | ||
parallel: true | ||
|
||
notify: | ||
needs: | ||
- unit-tests | ||
|
||
name: Code Coverage | ||
if: ${{ success() }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Coveralls Finished | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel-finished: true | ||
|
||
publish: | ||
needs: | ||
- notify | ||
|
||
name: Publish to npm | ||
if: ${{ success() && github.event_name == 'push'}} | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
job-status: ${{ job.status }} | ||
|
||
steps: | ||
- name: git checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: lerna install | ||
run: | | ||
npm install lerna@^3.22.0 | ||
npm install | ||
- name: timestamp | ||
id: timestamp | ||
run: | | ||
node ./scripts/timestamp.js | ||
- name: build and publish | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | ||
npm version --no-git-tag-version --yes --exact ${{ steps.timestamp.outputs.stamp }} | ||
./node_modules/.bin/lerna version --no-git-tag-version --yes --exact ${{ steps.timestamp.outputs.stamp }} | ||
./node_modules/.bin/lerna exec --ignore dingus -- npm publish --access public --tag=unstable 2>&1 | ||
rm ~/.npmrc |
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,56 @@ | ||
name: publish | ||
|
||
on: | ||
release: | ||
types: | ||
- released | ||
|
||
jobs: | ||
publish: | ||
name: Publish to npm | ||
|
||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
job-status: ${{ job.status }} | ||
|
||
steps: | ||
- name: git checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: lerna install | ||
run: | | ||
npm install lerna@^3.22.0 | ||
npm install | ||
- name: tag | ||
id: tag | ||
run: | | ||
node ./scripts/tag.js ${{ github.event.release.tag_name }} | ||
- name: build and publish | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | ||
npm version --no-git-tag-version --yes --exact ${{ github.event.release.tag_name }} | ||
./node_modules/.bin/lerna version --no-git-tag-version --yes --exact ${{ github.event.release.tag_name }} | ||
./node_modules/.bin/lerna exec --ignore dingus -- npm publish --access public ${{ steps.tag.outputs.tag }} 2>&1 | ||
rm ~/.npmrc | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
base: master | ||
commit-message: 'chore(actions): publish ${{ github.event.release.tag_name }} to npm' | ||
committer: GitHub <noreply@github.com> | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
signoff: true | ||
branch: ap-publish-${{ github.event.release.tag_name }} | ||
delete-branch: true | ||
title: 'chore(actions): publish ${{ github.event.release.tag_name }} to npm' | ||
body: | | ||
# NPM Publish | ||
Publish build to NPM | ||
assignees: ${{ github.actor }} | ||
reviewers: ${{ github.actor }} | ||
draft: false |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.