Skip to content

Commit

Permalink
chore(github): migrate travis ci/cd to gh actions - I4 (#352)
Browse files Browse the repository at this point in the history
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
  • Loading branch information
jolanglinais committed Feb 1, 2021
1 parent 86f30a5 commit 12aa266
Show file tree
Hide file tree
Showing 43 changed files with 207 additions and 763 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/build.yml
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
56 changes: 56 additions & 0 deletions .github/workflows/publish.yml
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
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

56 changes: 0 additions & 56 deletions .travis/base.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .travis/build.cfg

This file was deleted.

104 changes: 0 additions & 104 deletions .travis/deploy.sh

This file was deleted.

Loading

0 comments on commit 12aa266

Please sign in to comment.