Bump version: 1.1.0 → 1.1.1 #24
Workflow file for this run
This file contains hidden or 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 Draft Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| create-draft: | |
| name: Create Draft Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get tag info | |
| id: tag_info | |
| run: | | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT | |
| echo "version=${TAG_NAME#v}" >> $GITHUB_OUTPUT | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| # Get the previous tag | |
| PREV_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "") | |
| if [ -n "$PREV_TAG" ]; then | |
| echo "Getting changes since $PREV_TAG" | |
| CHANGELOG=$(git log --pretty=format:"- %s (%h)" $PREV_TAG..HEAD) | |
| else | |
| echo "Getting all commits" | |
| CHANGELOG=$(git log --pretty=format:"- %s (%h)") | |
| fi | |
| # Save changelog to file | |
| cat << EOF > changelog.md | |
| ## What's Changed | |
| $CHANGELOG | |
| EOF | |
| # Output for use in release | |
| { | |
| echo 'CHANGELOG<<EOF' | |
| cat changelog.md | |
| echo EOF | |
| } >> $GITHUB_OUTPUT | |
| - name: Create Draft Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.tag_info.outputs.tag_name }} | |
| name: Release ${{ steps.tag_info.outputs.tag_name }} | |
| body: ${{ steps.changelog.outputs.CHANGELOG }} | |
| draft: true | |
| prerelease: false | |
| generate_release_notes: true |