v7.0.0-alpha.4: TypeScript and Build System Improvements #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') }} |