From 42d43b27085475a34c64b022961083f3da22bf9e Mon Sep 17 00:00:00 2001 From: Se7enZ Date: Mon, 2 Dec 2024 14:47:39 +1030 Subject: [PATCH] build: Prepare release draft in Github actions. --- .github/workflows/release.yml | 44 ++++++++++++++++--- .../release-checklist.md | 4 +- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e81d4c6ea10a..841a2e640687 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,13 @@ on: - 'v[0-9]+.[0-9]+.[0-9]+' - 'v[0-9]+.[0-9]+[0-9a-z]+' workflow_dispatch: + create_release: + description: Create a draft release + default: no + type: choice + options: + - yes + - no jobs: check: @@ -102,7 +109,7 @@ jobs: delete-merged: true release: - name: Sign release + name: Sign and prepare release draft needs: - check - artifact @@ -130,18 +137,14 @@ jobs: trust_level: 5 - name: Set default GPG key - run: | - gpg -K - gpg --list-secret-keys - echo "default-key ${{ steps.gpg.outputs.keyid }}" >> ~/.gnupg/gpg.conf - cat ~/.gnupg/gpg.conf + run: echo "default-key ${{ steps.gpg.outputs.keyid }}" >> ~/.gnupg/gpg.conf - name: Sign release run: | sudo apt-get install -y lowdown ./configure - # TODO: configure GPG key tools/build-release.sh --without-zip sign + mv release/SHA256SUMS.asc${{ steps.gpg.outputs.keyid }} release/SHA256SUMS.asc - name: Upload signed artifact uses: actions/upload-artifact@v4 @@ -149,3 +152,30 @@ jobs: name: c-lightning-${{ env.version }} overwrite: true path: release/ + + - name: Determine release data + id: release_data + run: | + VERSION=${{ env.version }} + CHANGELOG_VERSION=${VERSION#v} + echo "CHANGELOG_VERSION=$CHANGELOG_VERSION" + echo "changelog_version=$CHANGELOG_VERSION" >> "$GITHUB_OUTPUT" + + CHANGELOG_TITLE=$(grep "## \[${CHANGELOG_VERSION}\]" CHANGELOG.md) + echo "CHANGELOG_TITLE=$CHANGELOG_TITLE" + echo "changelog_title=$CHANGELOG_TITLE" >> "$GITHUB_OUTPUT" + + RELEASE_TITLE=$(echo $CHANGELOG_TITLE | cut -d'"' -f2) + echo "RELEASE_TITLE=$RELEASE_TITLE" + echo "release_title=$RELEASE_TITLE" >> "$GITHUB_OUTPUT" + + - name: Prepare release draft + if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.create_release == 'yes') + uses: softprops/action-gh-release@v2 + with: + name: "${{ env.version }} ${{ steps.release_data.outputs.release_title }}" + tag_name: ${{ env.version }} + draft: true + prerelease: contains(env.version, "-rc") + files: release/* + fail_on_unmatched_files: true diff --git a/doc/contribute-to-core-lightning/release-checklist.md b/doc/contribute-to-core-lightning/release-checklist.md index 52b6604b14e4..6cf9dd8e40cf 100644 --- a/doc/contribute-to-core-lightning/release-checklist.md +++ b/doc/contribute-to-core-lightning/release-checklist.md @@ -32,10 +32,10 @@ Here's a checklist for the release process. 1. Merge the above PR. 2. Tag it `git pull && git tag -s vrc1`. Note that you should get a prompt to give this tag a 'message'. Make sure you fill this in. 3. Confirm that the tag will show up for builds with `git describe` -4. Push the tag to remote `git push --tags` (pushing the tag will kickoff the "Release 🚀" CI action which builds the release targets). +4. Push the tag to remote `git push --tags` (pushing the tag will kickoff the "Release 🚀" CI action which builds the release targets and a draft release). 7. Run the script `contrib/cl-repro.sh` for [Builder image setup](https://docs.corelightning.org/docs/repro#builder-image-setup). This will create the required builder images `cl-repro-` for the next step. 8. Sign the release locally by running `tools/build-release.sh --without-zip sign` which will sign the release contents and create SHA256SUMS and SHA256SUMS.asc in the release folder. Compare these with `c-lightning-`.zip on GitHub. -9. Draft a new `vrc1` release on Github and check `Set as a pre-release` option. +9. Check the generated draft `vrc1` release on Github and check `Set as a pre-release` option. Add the SHA256SUMS.asc from your local release folder to newly drafted release, replacing it. 9. Announce rc1 release on core-lightning's release-chat channel on Discord & [BuildOnL2](https://community.corelightning.org/c/general-questions/). 10. Use `devtools/credit --verbose v` to get commits, days and contributors data for release note. 11. Prepare release notes draft including information from above step, and share with the team for editing.