Skip to content

Commit

Permalink
Merge pull request #98 from VikeLabs/fix/auto-npm-publishing
Browse files Browse the repository at this point in the history
split bump npm version into its own job
  • Loading branch information
isaaccormack authored Feb 27, 2021
2 parents 968ceee + 6492ce2 commit b2fbcdf
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ jobs:
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

publish-npm:
if: github.ref == 'refs/heads/master' && github.actor == 'vikelabs-bot'
bump-npm-version:
if: github.ref == 'refs/heads/master' && github.actor != 'vikelabs-bot'
needs: [ lint, build, test ]
environment: deployment
runs-on: ubuntu-latest
Expand All @@ -108,6 +108,20 @@ jobs:
git config --global user.name 'vikelabs-bot'
git config --global user.email 'vikelabs-bot-github@vikelabs.ca'
- name: Bump minor version
uses: 'phips28/gh-action-bump-version@master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-npm:
if: github.ref == 'refs/heads/master' && github.actor == 'vikelabs-bot'
needs: [ lint, build, test ]
environment: deployment
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
with:
Expand All @@ -124,11 +138,6 @@ jobs:
- name: Install dependencies
run: npm ci --ignore-scripts --no-audit --no-progress

- name: Bump minor version
uses: 'phips28/gh-action-bump-version@master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create .npmrc for auth token publishing
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
env:
Expand Down

0 comments on commit b2fbcdf

Please sign in to comment.