Skip to content

Commit

Permalink
Update the release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pleek91 committed Aug 30, 2023
1 parent 7371717 commit 0b7523c
Showing 1 changed file with 13 additions and 31 deletions.
44 changes: 13 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
id: check

- name: Cancel
if: steps.check.outputs.changed == 'false'
uses: andymckay/[email protected]

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

0 comments on commit 0b7523c

Please sign in to comment.