Skip to content

Commit

Permalink
Merge dfd2cdf into abe50b0
Browse files Browse the repository at this point in the history
  • Loading branch information
austin-rausch committed Oct 15, 2021
2 parents abe50b0 + dfd2cdf commit ac7cdb2
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 72 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/pr-branch-build.yml
@@ -0,0 +1,59 @@
name: PR Build and Test

on:
pull_request

jobs:
test:
runs-on: ubuntu-latest
name: Node.JS ${{ matrix.node-version }}
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: yarn install
- name: Test
run: yarn test
- name: Coverage
run: yarn coverage
- name: Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: .nyc_output/lcov.info
flag-name: run-${{ matrix.node }}
parallel: true
preRelease:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org
- name: Install
run: yarn install --frozen-lockfile
- name: Version
env:
PRE_ID: pr-${{ github.event.number }}-${{ github.run_id }}
run: npm version prepatch --git-tag-version=false --preid="${PRE_ID}-$(date '+%s')"
- name: PrePublish
env:
NODE_AUTH_TOKEN: ${{secrets.LIFEOMIC_NPM_TOKEN}}
PR_TAG: pr-${{ github.event.number }}
run: npm publish --tag "${PR_TAG}"
finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,52 @@
name: Release

on:
push:
branches:
- 'master'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org
- name: Install
run: yarn install --frozen-lockfile
- name: Test
env:
LAMBDA_REMOTE_DOCKER: true
run: yarn test
- id: tagExistsAndVersion
name: Check if tags exist in NPM and GIT
run: |
set +e
packageName="$(node -p "require('./package').name")"
packageVersion="$(node -p "require('./package').version")"
packageNameAndVersion="${packageName}@${packageVersion}"
npm view "${packageNameAndVersion}" dist.tarball | grep "${packageVersion}" > /dev/null
npmTagExists="$([ "$?" = "0" ] && BOOL="true" || BOOL="false"; echo $BOOL)"
set -e
echo "::set-output name=npmTagExists::${npmTagExists}"
echo "::set-output name=packageVersion::${packageVersion}"
- name: Publish
if: ${{ steps.tagExistsAndVersion.outputs.npmTagExists == 'false'}}
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.LIFEOMIC_NPM_TOKEN}}
- name: Create Release
if: ${{ steps.tagExistsAndVersion.outputs.npmTagExists == 'false'}}
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.tagExistsAndVersion.outputs.packageVersion }}
release_name: v${{ steps.tagExistsAndVersion.outputs.packageVersion }}
draft: false
prerelease: false
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

7 changes: 2 additions & 5 deletions package.json
Expand Up @@ -18,12 +18,9 @@
"lint": "tslint --format codeFrame --project tsconfig.json 'src/**/*.ts' 'test/**/*.ts'",
"pretest": "yarn lint && yarn compile-test",
"test": "BABEL_ENV=test nyc ava 'work/dist-test/test/**/*.test.js'",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"coverage": "nyc report --reporter=text-lcov > ./.nyc_output/lcov.info",
"prebuild": "yarn test",
"build": "yarn compile-src && ./tools/bin/postbuild",
"publish-patch": "yarn build && ./tools/bin/publish patch",
"publish-minor": "yarn build && ./tools/bin/publish minor",
"publish-major": "yarn build && ./tools/bin/publish major"
"build": "yarn compile-src && ./tools/bin/postbuild"
},
"repository": {
"type": "git",
Expand Down
50 changes: 0 additions & 50 deletions tools/bin/publish

This file was deleted.

0 comments on commit ac7cdb2

Please sign in to comment.