Skip to content

Commit

Permalink
Headless release: Automatically copy from 'changelog.txt' into github…
Browse files Browse the repository at this point in the history
… release notes

Signed-off-by: Tom Sellman <tom.sellman@seqera.io>
  • Loading branch information
tom-seqera committed Dec 4, 2024
1 parent 13341be commit 19f01c4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
36 changes: 35 additions & 1 deletion .github/scripts/deploy-to-github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,47 @@ cd "$(dirname "$0")/../.."
# read the nextflow version
read -r NF_VERSION<VERSION

function get_change_notes() {
# extract the most recent changelog notes from 'changelog.txt',
# which should have been manually updated for the release
#
# TODO eventually replace with proper automated changelog generation
is_relevant=false
while IFS="" read -r line || [ -n "$line" ]
do
# ignore all lines until we find the correct version
if [[ "$line" == "$NF_VERSION "* ]]; then
is_relevant=true
fi

# then, if line starts with a dash, add to notes
if [[ "$is_relevant" == true && "$line" == -* ]] ; then
printf '%s\n' "$line"
fi
# until the first empty line
if [[ "$is_relevant" == true && -z "$line" ]]; then
break
fi
done < changelog.txt
}

echo "Publishing nextflow release to github"

# create a github (pre)release and attach launcher and dist files
# use --verify-tag to fail if tag doesn't exist
notes=$(get_change_notes)

# if edge version, mark as pre-release
if [[ "$NF_VERSION" =~ .+(-edge|-EDGE) ]]; then
prerelease='--prerelease'
else
prerelease=
fi

gh release create \
--prerelease \
--draft $prerelease \
--title "Version $NF_VERSION" \
--notes "$notes" \
--verify-tag \
"v$NF_VERSION" \
nextflow \
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/publish-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ read -r NF_VERSION<VERSION

# determine publish location
S3_RELEASE_BUCKET=${S3_RELEASE_BUCKET:-'www2.nextflow.io'}
if [[ "$NF_VERSION" =~ /^.+(-edge|-EDGE)$/ ]]; then
if [[ "$NF_VERSION" =~ .+(-edge|-EDGE) ]]; then
S3_RELEASE_DIR="releases/edge"
else
S3_RELEASE_DIR="releases/latest"
Expand Down
4 changes: 2 additions & 2 deletions make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ echo "
------------------------------------------------------------
Release commit pushed.
This should trigger a github release workflow.
Once the workflow is complete, you should add the changelog
to the github release.
Once the workflow is complete, you should check and publish
the draft github release.
------------------------------------------------------------
"

0 comments on commit 19f01c4

Please sign in to comment.