From fc9afab52deedd4abfd868d2c9737eaef6c8969e Mon Sep 17 00:00:00 2001 From: Se7enZ Date: Mon, 11 Nov 2024 16:40:07 +0100 Subject: [PATCH] build: Prepare release draft in Github actions. --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e32d52b1901..5512fd3bc025 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -113,7 +113,7 @@ jobs: delete-merged: true release: - name: Sign release + name: Sign and prepare release draft needs: - check - artifact @@ -141,11 +141,7 @@ 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: | @@ -153,6 +149,7 @@ jobs: ./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 @@ -160,3 +157,28 @@ 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" + # TODO: Explore computing the body. + + - name: Prepare release draft + 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