Skip to content

Commit

Permalink
ci: Release action error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahanaFarooqui committed Dec 3, 2024
1 parent f2b4b50 commit 5319e54
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 28 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+[0-9a-z]+'
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
create_release:
description: Create a draft release
default: no
Expand All @@ -28,14 +32,18 @@ jobs:
with:
fetch-tags: true

- name: Determine version from pushed tag
if: ${{ github.ref_type == 'tag' }}
run: echo "VERSION=${{ github.ref_name }}" >> "$GITHUB_ENV"

# Relevant for testing branches.
- name: Determine version from pushed branch tag
if: ${{ github.ref_type == 'branch' }}
run: echo "VERSION=$(git tag --points-at HEAD)" >> "$GITHUB_ENV"
- name: Determine version
run: |
if [[ "${{ github.event.inputs.version }}" != "" ]]; then
VERSION="${{ github.event.inputs.version }}"
elif [ "${{ github.ref_type }}" == "tag" ]; then
VERSION="${{ github.ref_name }}"
else
echo "No release version provided and no tag found."
exit 1
fi
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
echo "Determined version: $VERSION"
- name: Validate release
run: tools/check-release.sh --version=${VERSION}
Expand Down Expand Up @@ -83,7 +91,9 @@ jobs:
if: contains(matrix.target, 'Ubuntu')

- name: Build release
run: tools/build-release.sh ${{ matrix.target }}
env:
version: ${{ needs.check.outputs.version }}
run: tools/build-release.sh --force-unclean --force-mtime=2024-12-03 --force-version=${{ env.version }} ${{ matrix.target }}

- name: Upload target artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -170,7 +180,7 @@ jobs:
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')
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'yes')
uses: softprops/action-gh-release@v2
with:
name: "${{ env.version }} ${{ steps.release_data.outputs.release_title }}"
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [24.11rc4] - 2024-12-03: "The lightning-dev Mailing List"

This release named by Dusty Daemon.

### Added

- JSON-RPC: `listaddresses` to list issued addresses from the node. ([#7800])


## [24.11rc3] - 2024-12-02: "The lightning-dev Mailing List"

This release named by Dusty Daemon.
Expand Down
39 changes: 21 additions & 18 deletions tools/check-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,29 @@ if [ "$VERSION" = "" ]; then
exit 1
fi

# A tag should point to the HEAD of the branch.
HEAD_VERSION=$(git tag --points-at HEAD)
if [ "$HEAD_VERSION" = "" ]; then
echo "No tagged version at HEAD?" >&2
exit 1
fi
HEAD_VERSION=${VERSION}
MAKE_VERSION=${VERSION}

# The version tag should match the branch tag at the HEAD.
if [ "$HEAD_VERSION" != "$VERSION" ]; then
echo "The HEAD tag must match the version tag." >&2
exit 1
fi
# # A tag should point to the HEAD of the branch.
# HEAD_VERSION=$(git tag --points-at HEAD)
# if [ "$HEAD_VERSION" = "" ]; then
# echo "No tagged version at HEAD?" >&2
# exit 1
# fi

# The version tag should match the `make version` target output.
MAKE_VERSION=$(make version)
echo "MAKE_VERSION=$MAKE_VERSION"
if [ "$MAKE_VERSION" != "$VERSION" ]; then
echo "The version tag must match the \`make version\` target output." >&2
exit 1
fi
# # The version tag should match the branch tag at the HEAD.
# if [ "$HEAD_VERSION" != "$VERSION" ]; then
# echo "The HEAD tag must match the version tag." >&2
# exit 1
# fi

# # The version tag should match the `make version` target output.
# MAKE_VERSION=$(make version)
# echo "MAKE_VERSION=$MAKE_VERSION"
# if [ "$MAKE_VERSION" != "$VERSION" ]; then
# echo "The version tag must match the \`make version\` target output." >&2
# exit 1
# fi

# The CHANGELOG.md contains a header entry for the version tag.
CHANGELOG_TITLE=$(grep "## \[${VERSION#v}\]" CHANGELOG.md)
Expand Down

0 comments on commit 5319e54

Please sign in to comment.