Skip to content

Commit

Permalink
github: Read tag on HEAD in Github Actions
Browse files Browse the repository at this point in the history
Running `git describe` in local setup correctly identifies the tag available on the tag. But `docker buildx` via actions does not identify it without `--tags` param.

Reference Issue: ElementsProject#7626

Changelog-Fixed: Docker image created via github actions correctly reads the tag available on the HEAD.
  • Loading branch information
ShahanaFarooqui committed Sep 5, 2024
1 parent ad37328 commit 1a71e15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:

- name: Check version tag
run: >-
git describe --always --dirty=-modded --abbrev=7
git describe --tags --always --dirty=-modded --abbrev=7
- name: Setup Version
env:
WORKDIR: ${{ matrix.WORKDIR }}
run: |
echo "VERSION=$(git describe --abbrev=0).post$(git describe --abbrev=1 | awk -F "-" '{print $2}')" >> $GITHUB_ENV
echo "VERSION=$(git describe --tags --abbrev=0).post$(git describe --tags --abbrev=1 | awk -F "-" '{print $2}')" >> $GITHUB_ENV
- name: Set up values
id: set-values
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
run: |
echo "POETRY VERSION PUBLISH: $(poetry --version)"
cd ${{ env.WORKDIR }}
export VERSION=$(git describe --abbrev=0)
export VERSION=$(git describe --tags --abbrev=0)
echo "Pyln VERSION: $VERSION"
make upgrade-version NEW_VERSION=$VERSION
python3 -m pip config set global.timeout 150
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /usr/bin/make

# Extract version from git, or if we're from a zipfile, use dirname
VERSION=$(shell git describe --always --dirty=-modded --abbrev=7 2>/dev/null || pwd | sed -n 's|.*/c\{0,1\}lightning-v\{0,1\}\([0-9a-f.rc\-]*\)$$|\1|gp')
VERSION=$(shell git describe --tags --always --dirty=-modded --abbrev=7 2>/dev/null || pwd | sed -n 's|.*/c\{0,1\}lightning-v\{0,1\}\([0-9a-f.rc\-]*\)$$|\1|gp')

# Next release.
CLN_NEXT_VERSION := v24.08
Expand Down
2 changes: 1 addition & 1 deletion tools/repro-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ else
fi

PLATFORM="$OS"-"$VER"
VERSION=${FORCE_VERSION:-$(git describe --always --dirty=-modded --abbrev=7 2>/dev/null || pwd | sed -n 's,.*/clightning-\(v[0-9.rc\-]*\)$,\1,p')}
VERSION=${FORCE_VERSION:-$(git describe --tags --always --dirty=-modded --abbrev=7 2>/dev/null || pwd | sed -n 's,.*/clightning-\(v[0-9.rc\-]*\)$,\1,p')}

# eg. ## [0.6.3] - 2019-01-09: "The Smallblock Conspiracy"
# Skip 'v' here in $VERSION
Expand Down

0 comments on commit 1a71e15

Please sign in to comment.