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 4022643
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 26 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+[0-9a-z]+'
workflow_dispatch:
inputs:
create_release:
description: Create a draft release
default: no
type: choice
options:
- yes
- no
ref_type:
description: 'Ref type (tag or branch)'
required: true
default: 'tag'
ref_name:
description: 'Ref name (e.g., v24.11 or master)'
required: true
default: 'v24.11'

jobs:
check:
Expand All @@ -26,16 +35,24 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
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 [ "${{ inputs.ref_type }}" == "tag" ]; then
VERSION="${{ inputs.ref_name }}"
elif [ "${{ github.ref_type }}" == "tag" ]; then
VERSION="${{ github.ref_name }}"
elif [ "${{ github.ref_type }}" == "branch" ]; then
# latest tagged version
VERSION=$(git describe --tags --abbrev=0)
if [ -z "$VERSION" ]; then
VERSION="${{ github.ref_name }}"
fi
fi
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
echo "Determined version: $VERSION"
- name: Validate release
run: tools/check-release.sh --version=${VERSION}
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 4022643

Please sign in to comment.