From 0b7523ca43eaf8decefdb6c448a96c04241738ea Mon Sep 17 00:00:00 2001 From: Craig Harshbarger Date: Wed, 30 Aug 2023 10:34:37 -0500 Subject: [PATCH] Update the release workflow --- .github/workflows/release.yml | 44 +++++++++++------------------------ 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26fd6d11..6cb1bce6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,64 +1,46 @@ name: Release on: - workflow_dispatch: push: paths: - package.json branches: - main - + jobs: - version-change-check: - name: Check Package Version - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Check Package Version - uses: EndBug/version-check@v2.1.0 - id: check - - - name: Cancel - if: steps.check.outputs.changed == 'false' - uses: andymckay/cancel-action@0.2 - build-and-publish: name: Build & Publish Release runs-on: ubuntu-latest - needs: [version-change-check] environment: 'prod' steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version-file: ".nvmrc" - name: Install dependencies - run: npm ci install + run: npm ci - name: Build package run: npm run build - name: Publish Package id: publish - uses: JS-DevTools/npm-publish@v1 + uses: JS-DevTools/npm-publish@v2 with: token: ${{ secrets.NPM_PUBLISH_TOKEN }} access: public - - - name: Create Release - uses: actions/create-release@v1 + strategy: upgrade + + - name: Create release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: v${{ steps.publish.outputs.version }} - release_name: Release ${{ steps.publish.outputs.version }} - body: | - Please refer to [CHANGELOG.md](https://github.com/PrefectHQ/vue-compositions/blob/main/CHANGELOG.md) for details. + tag: ${{ steps.publish.outputs.version }} + run: | + gh release create "$tag" \ + --repo="$GITHUB_REPOSITORY" \ + --title="Release ${tag#v}" \ + --generate-notes