Skip to content

Commit

Permalink
Merge pull request #25 from lifeomic/no-more-travisci
Browse files Browse the repository at this point in the history
Switch from travisci to github actions
  • Loading branch information
Anthony Roach authored Feb 19, 2021
2 parents e1cb5e6 + 42b516c commit ded6b05
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 21 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/pr-branch-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PR Branch Build and Test

on:
push:
branches-ignore:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Test
run: |
yarn install
yarn test
52 changes: 52 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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: Test
run: |
yarn install
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
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lifeomic/alpha-cli",
"version": "1.0.1",
"version": "1.0.2",
"description": "Curl-like CLI for the Alpha client",
"author": "LifeOmic <[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit ded6b05

Please sign in to comment.