Skip to content

Commit

Permalink
chore: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Sep 19, 2021
1 parent 6b2e12c commit 62f75d4
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
branches:
- master

env:
NODE_VERSION: 16.x

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Get package name
run: echo "PACKAGE_NAME=$(jq .name package.json | tr -d '"')" >> $GITHUB_ENV
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.BOT_TOKEN }}
release-type: node
package-name: ${{ env.PACKAGE_NAME }}
bump-minor-pre-major: Yes
- uses: actions/checkout@v2
# These if statements ensure that a publication only occurs when a new release is created
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- run: npm install
if: ${{ steps.release.outputs.release_created }}
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_BOT_TOKEN }}
if: ${{ steps.release.outputs.release_created }}

0 comments on commit 62f75d4

Please sign in to comment.