Skip to content

Commit

Permalink
build: Prepare release draft in Github actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
s373nZ committed Nov 11, 2024
1 parent 56c2b5b commit 9a6148c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 10 deletions.
44 changes: 37 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ on:
description: Tag to release
required: true
type: string
create_release:
description: Create a draft release
default: no
type: choice
options:
- yes
- no

jobs:
check:
Expand Down Expand Up @@ -111,7 +118,7 @@ jobs:
delete-merged: true

release:
name: Sign release
name: Sign and prepare release draft
needs:
- check
- artifact
Expand Down Expand Up @@ -139,22 +146,45 @@ 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
with:
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
6 changes: 3 additions & 3 deletions doc/contribute-to-core-lightning/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ Here's a checklist for the release process.
3. Confirm that the tag will show up for builds with `git describe`
4. Push the tag to remote `git push --tags`.
5. Pushing the tag will kickoff the "Release 🚀" CI action which builds the release targets. Verify this action completed successfully and download the artifact it produces named `c-lightning-<release tag>`.zip and extract it into a directory named `release` in the root of your local repository. Ex. `unzip -d release/ ~/Downloads/c-lightning-<release tab>.zip`
6. 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.
7. Draft a new `v<VERSION>rc1` release on Github and check `Set as a pre-release` option.
8. Upload reproducible builds, SHA256SUMS and SHA256SUMS.asc from the release folder to newly drafted release.
6. The CI will also create a draft release in Github with the assets attached. Locate the release and edit it to add the body copy, verify the settings and tweak as needed.
7. Build, verify and 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.
8. Compare the signatures to those from CI and your key to the SHA256SUMS.asc file. Then, upload 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<PREVIOUS-VERSION>` 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.
Expand Down

0 comments on commit 9a6148c

Please sign in to comment.