Skip to content

7.0.0-alpha.7: feat(events): add new event types and improve selection #4

7.0.0-alpha.7: feat(events): add new event types and improve selection

7.0.0-alpha.7: feat(events): add new event types and improve selection #4

Workflow file for this run

name: Create Release
on:
push:
branches:
- main
jobs:
check-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get version changes
id: version
run: |
git diff HEAD^ HEAD -U0 package.json | grep '^[+-].*"version"' || echo "No version changes"
if git diff HEAD^ HEAD -U0 package.json | grep '^[+-].*"version"' > /dev/null; then
echo "version_changed=true" >> $GITHUB_OUTPUT
NEW_VERSION=$(node -p "require('./package.json').version")
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
else
echo "version_changed=false" >> $GITHUB_OUTPUT
fi
- name: Get commit message
if: steps.version.outputs.version_changed == 'true'
id: commit
run: |
COMMIT_MSG=$(git log -1 --pretty=%B)
echo "message<<EOF" >> $GITHUB_OUTPUT
echo "$COMMIT_MSG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release
if: steps.version.outputs.version_changed == 'true'
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.version.outputs.new_version }}
name: Release v${{ steps.version.outputs.new_version }}
body: ${{ steps.commit.outputs.message }}
draft: false
prerelease: ${{ contains(steps.version.outputs.new_version, 'alpha') || contains(steps.version.outputs.new_version, 'beta') }}