Skip to content

Commit

Permalink
normalize github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
brettneese committed Feb 12, 2021
1 parent 042e10c commit 4697081
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 33 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/node.js.yml

This file was deleted.

File renamed without changes.
17 changes: 17 additions & 0 deletions example/.github/workflows/autorelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Autorelease

on:
push:
tags:
- "v*.*.*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.BOTTY_TOKEN }} # https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
38 changes: 38 additions & 0 deletions example/.github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build-and-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# need to use the Botty personal access token (PAT) so that this workflow can trigger other
# workflows. See https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
with:
token: ${{ secrets.BOTTY_TOKEN }}
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
registry-url: https://npm.pkg.github.com/
scope: "@hbkengineering"
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{secrets.GPR_TOKEN}}
- run: npm run build --if-present
- run: npm test --if-present
- name: Autoversion
if: contains(github.event.head_commit.message, 'HBKEngineering/dependabot/')
run: |
git config --global user.email "apps@hbkengineering.com"
git config --global user.name "GitHub Actions"
npm version patch --force # --force ignores the deleted .npmrc file
git push --follow-tags
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
node-version: 12
registry-url: https://npm.pkg.github.com/
scope: "@hbkengineering"
- run: rm .npmrc
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{secrets.GPR_TOKEN}}
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
"devDependencies": {
"@hbkapps/convict": "^4.1.0",
"aws-sdk": "^2.167.0"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
}
}

0 comments on commit 4697081

Please sign in to comment.