Skip to content

Commit

Permalink
ci: workflow to autogen a changelog and publish to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Aug 12, 2023
1 parent 5801163 commit d24fbd4
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,38 @@ jobs:

- name: End-to-End Tests
run: npm run test-e2e

publish-node:
runs-on: ubuntu-latest

needs: [build, unit-tests, e2e-tests]

# by default, permissions are read-only, read + write is required for git pushes
permissions:
contents: write

steps:
- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v4
with:
github-token: ${{ secrets.github_token }}
version-file: "./package.json,./package-lock.json"
output-file: "CHANGELOG.md"

- name: Publish to NPM
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: npm publish
env:
# `gh secret set NPM_TOKEN --app actions --body $NPM_TOKEN`
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Github Release
if: ${{ steps.changelog.outputs.skipped == 'false' }}
uses: softprops/action-gh-release@v1
with:
# output options: https://github.com/TriPSs/conventional-changelog-action#outputs
body: ${{ steps.changelog.outputs.clean_changelog }}
tag_name: ${{ steps.changelog.outputs.tag }}
# required in order for release events to be fired
token: ${{ secrets.GH_PERSONAL_TOKEN }}

0 comments on commit d24fbd4

Please sign in to comment.