Skip to content

Commit 42d43b2

Browse files
s373nZrustyrussell
authored andcommitted
build: Prepare release draft in Github actions.
1 parent 1f31aa7 commit 42d43b2

File tree

2 files changed

+39
-9
lines changed

2 files changed

+39
-9
lines changed

.github/workflows/release.yml

+37-7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ on:
88
- 'v[0-9]+.[0-9]+.[0-9]+'
99
- 'v[0-9]+.[0-9]+[0-9a-z]+'
1010
workflow_dispatch:
11+
create_release:
12+
description: Create a draft release
13+
default: no
14+
type: choice
15+
options:
16+
- yes
17+
- no
1118

1219
jobs:
1320
check:
@@ -102,7 +109,7 @@ jobs:
102109
delete-merged: true
103110

104111
release:
105-
name: Sign release
112+
name: Sign and prepare release draft
106113
needs:
107114
- check
108115
- artifact
@@ -130,22 +137,45 @@ jobs:
130137
trust_level: 5
131138

132139
- name: Set default GPG key
133-
run: |
134-
gpg -K
135-
gpg --list-secret-keys
136-
echo "default-key ${{ steps.gpg.outputs.keyid }}" >> ~/.gnupg/gpg.conf
137-
cat ~/.gnupg/gpg.conf
140+
run: echo "default-key ${{ steps.gpg.outputs.keyid }}" >> ~/.gnupg/gpg.conf
138141

139142
- name: Sign release
140143
run: |
141144
sudo apt-get install -y lowdown
142145
./configure
143-
# TODO: configure GPG key
144146
tools/build-release.sh --without-zip sign
147+
mv release/SHA256SUMS.asc${{ steps.gpg.outputs.keyid }} release/SHA256SUMS.asc
145148
146149
- name: Upload signed artifact
147150
uses: actions/upload-artifact@v4
148151
with:
149152
name: c-lightning-${{ env.version }}
150153
overwrite: true
151154
path: release/
155+
156+
- name: Determine release data
157+
id: release_data
158+
run: |
159+
VERSION=${{ env.version }}
160+
CHANGELOG_VERSION=${VERSION#v}
161+
echo "CHANGELOG_VERSION=$CHANGELOG_VERSION"
162+
echo "changelog_version=$CHANGELOG_VERSION" >> "$GITHUB_OUTPUT"
163+
164+
CHANGELOG_TITLE=$(grep "## \[${CHANGELOG_VERSION}\]" CHANGELOG.md)
165+
echo "CHANGELOG_TITLE=$CHANGELOG_TITLE"
166+
echo "changelog_title=$CHANGELOG_TITLE" >> "$GITHUB_OUTPUT"
167+
168+
RELEASE_TITLE=$(echo $CHANGELOG_TITLE | cut -d'"' -f2)
169+
echo "RELEASE_TITLE=$RELEASE_TITLE"
170+
echo "release_title=$RELEASE_TITLE" >> "$GITHUB_OUTPUT"
171+
172+
- name: Prepare release draft
173+
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.create_release == 'yes')
174+
uses: softprops/action-gh-release@v2
175+
with:
176+
name: "${{ env.version }} ${{ steps.release_data.outputs.release_title }}"
177+
tag_name: ${{ env.version }}
178+
draft: true
179+
prerelease: contains(env.version, "-rc")
180+
files: release/*
181+
fail_on_unmatched_files: true

doc/contribute-to-core-lightning/release-checklist.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ Here's a checklist for the release process.
3232
1. Merge the above PR.
3333
2. Tag it `git pull && git tag -s v<VERSION>rc1`. Note that you should get a prompt to give this tag a 'message'. Make sure you fill this in.
3434
3. Confirm that the tag will show up for builds with `git describe`
35-
4. Push the tag to remote `git push --tags` (pushing the tag will kickoff the "Release 🚀" CI action which builds the release targets).
35+
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).
3636
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-<codename>` for the next step.
3737
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-<release tag>`.zip on GitHub.
38-
9. Draft a new `v<VERSION>rc1` release on Github and check `Set as a pre-release` option.
38+
9. Check the generated draft `v<VERSION>rc1` 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.
3939
9. Announce rc1 release on core-lightning's release-chat channel on Discord & [BuildOnL2](https://community.corelightning.org/c/general-questions/).
4040
10. Use `devtools/credit --verbose v<PREVIOUS-VERSION>` to get commits, days and contributors data for release note.
4141
11. Prepare release notes draft including information from above step, and share with the team for editing.

0 commit comments

Comments
 (0)