-
Notifications
You must be signed in to change notification settings - Fork 1
Release v0.6.5 #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Release v0.6.5 #38
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| name: Create release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| github-release: | ||
| name: Create GitHub Release | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write # IMPORTANT: mandatory for making GitHub Releases | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Extract version from pyproject.toml | ||
| id: get_version | ||
| run: | | ||
| VERSION=$(grep -m 1 'version = ' pyproject.toml | cut -d '"' -f 2) | ||
| echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
| - name: Extract changelog notes for current version | ||
| id: get_changelog | ||
| run: | | ||
| VERSION=${{ env.VERSION }} | ||
| echo "Extracting changelog for version v$VERSION" | ||
|
|
||
| # Find the start of the current version section | ||
| START_LINE=$(grep -n "## \[v$VERSION\] - " CHANGELOG.md | cut -d: -f1) | ||
|
|
||
| if [ -z "$START_LINE" ]; then | ||
| echo "Warning: No changelog entry found for version v$VERSION" | ||
| echo "CHANGELOG_NOTES=" >> $GITHUB_ENV | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Find the start of the next version section (previous version) | ||
| NEXT_VERSION_LINE=$(tail -n +$((START_LINE + 1)) CHANGELOG.md | grep -n "^## \[v.*\] - " | head -1 | cut -d: -f1) | ||
|
|
||
| if [ -z "$NEXT_VERSION_LINE" ]; then | ||
| # No next version found, extract from current version till end of file | ||
| CHANGELOG_CONTENT=$(tail -n +$START_LINE CHANGELOG.md) | ||
| else | ||
| # Extract content from current version header to before next version | ||
| END_LINE=$((START_LINE + NEXT_VERSION_LINE - 1)) | ||
| CHANGELOG_CONTENT=$(sed -n "$START_LINE,$((END_LINE - 1))p" CHANGELOG.md) | ||
| fi | ||
|
|
||
| # Clean up the content but preserve the blank line after the header | ||
| # First, get the header line and add a blank line after it | ||
| HEADER_LINE=$(echo "$CHANGELOG_CONTENT" | head -1) | ||
| CONTENT_LINES=$(echo "$CHANGELOG_CONTENT" | tail -n +2 | sed '/^$/d' | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$//') | ||
|
|
||
| # Combine header + blank line + content | ||
| CHANGELOG_CONTENT=$(printf "%s\n\n%s" "$HEADER_LINE" "$CONTENT_LINES") | ||
|
|
||
| # Escape for GitHub Actions | ||
| echo "CHANGELOG_NOTES<<EOF" >> $GITHUB_ENV | ||
| echo "$CHANGELOG_CONTENT" >> $GITHUB_ENV | ||
| echo "EOF" >> $GITHUB_ENV | ||
| - name: Create GitHub Release | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| run: | | ||
| if [ -n "$CHANGELOG_NOTES" ]; then | ||
| gh release create "v$VERSION" \ | ||
| --repo "$GITHUB_REPOSITORY" \ | ||
| --title "v$VERSION" \ | ||
| --notes "$CHANGELOG_NOTES" | ||
| else | ||
| gh release create "v$VERSION" \ | ||
| --repo "$GITHUB_REPOSITORY" \ | ||
| --title "v$VERSION" \ | ||
| --notes "Release v$VERSION" | ||
| fi | ||
|
|
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the source branch is not named like
release/v*, theGet branch infostep exits early after printing “skipping version check” and never populatessource_release_version, but theCheck version matches release branchblock still runs unconditionally and compares the pyproject version against that empty string, triggering the exit-1 path. As a result every normal PR tomainnow fails this workflow instead of being skipped as intended.Useful? React with 👍 / 👎.