Skip to content

Commit

Permalink
adds gh-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
chrvadala committed Jun 1, 2020
1 parent 048adf9 commit 67c9482
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release

on:
push:
branches:
- stable

jobs:
build:
runs-on: ubuntu-18.04
outputs:
version: ${{ env.VERSION }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: echo "::set-env name=VERSION::$(jq '.version' package.json)"
- run: yarn install
- run: yarn build
- run: yarn pack --filename artifact.tgz
- uses: actions/upload-artifact@v2
with:
name: artifact
path: artifact.tgz
- run: yarn ci

npm-publish:
runs-on: ubuntu-18.04
needs: build
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: 'https://registry.npmjs.org'
- uses: actions/download-artifact@v2
with:
name: artifact
path: /tmp
- run: tar xvzf /tmp/artifact.tgz
- run: yarn publish ./package
env:
VERSION: ${{ fromJSON(needs.build.outputs.version) }}
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}

tag-release:
runs-on: ubuntu-18.04
needs: [build, npm-publish]
steps:
- uses: actions/checkout@v2
- name: Create TAG
run: |
git tag $RELEASE
git push --follow-tags
env:
release: v${{ fromJSON(needs.build.outputs.version) }}

gh-release:
runs-on: ubuntu-18.04
needs: [build, npm-publish]
steps:
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ fromJSON(needs.build.outputs.version) }}
release_name: Release ${{ fromJSON(needs.build.outputs.version) }}
body: Release ${{ fromJSON(needs.build.outputs.version) }}
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test

on:
- push
- pull_request

jobs:
build:
strategy:
matrix:
os: [ ubuntu-18.04 ]
node: [ 10, 12 ]
name: Test Nodejs v${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn install
- run: yarn build
- run: yarn ci
- name: Publish Coveralls
uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-nodejs-v${{ matrix.node }}-${{ matrix.os }}
parallel: true

finish:
name: Finish
needs: build
runs-on: ubuntu-18.04
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

0 comments on commit 67c9482

Please sign in to comment.