-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] Update release flow to create release and publish on merge wit…
…h main (#141) * update release flow * try this * try this * remove dash * try this * try this * try this * fix version location * update changelog * test * test * try this * testitout * try this * try this * try this
- Loading branch information
1 parent
a1d535d
commit 2aefd48
Showing
3 changed files
with
121 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Test release notes to delete before merge | ||
on: push | ||
|
||
jobs: | ||
display-github-release-notes: | ||
name: Create GitHub Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Extract version from _version.py | ||
id: get_version | ||
run: | | ||
version=$(python -c "exec(open('pasqal_cloud/_version.py').read()); print(__version__)") | ||
echo "VERSION=$version" >> $GITHUB_ENV | ||
- name: Debug CHANGELOG.md | ||
run: cat CHANGELOG.md | ||
|
||
- name: Get release notes from CHANGELOG.md | ||
run: | | ||
version=${{ env.VERSION }} | ||
# Extract notes from changelog | ||
notes=$(awk -v ver="$version" ' | ||
BEGIN { found_version=0; leading_blank=1; } | ||
/## \[/ { if (found_version) { exit } } | ||
/## \['"$version"'\]/ { | ||
found_version=1; | ||
next | ||
} | ||
found_version { | ||
# Remove the _released line | ||
if ($0 ~ /^_released/) { next } | ||
# Remove leading ### or ## or # and any additional whitespace | ||
gsub(/^#+ +/, "", $0); | ||
# Check if the line is blank | ||
if ($0 != "") { | ||
print $0; # Print the current line | ||
leading_blank=0; # Reset leading blank flag | ||
} else if (!leading_blank) { | ||
print ""; # Print a blank line for subsequent empty lines | ||
} | ||
} | ||
' CHANGELOG.md) | ||
echo "Extracted notes: $notes" | ||
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV | ||
echo "$notes" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Display release notes | ||
run: echo "${{ env.RELEASE_NOTES }}" |
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