From deb2eeb989ebd3fff2234c8b6d09cad0993c9b4c Mon Sep 17 00:00:00 2001 From: MRoci Date: Wed, 31 Mar 2021 11:46:37 +0200 Subject: [PATCH] add workflow to publish a release on NPM and on Github Release Publish package on NPM registry & create Github release when a new Tag is pushed --- .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..af7cff5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: publish release + +on: + push: + tags: + - '*' + +jobs: + # publish on NPM registry + publish-npm: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + registry-url: https://registry.npmjs.org/ + - name: Publish on NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + # create gh release + gh-release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Generate Changelog + uses: scottbrenner/generate-changelog-action@master + id: generate_changelog + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + body: | + ${{ steps.generate_changelog.outputs.changelog }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}