Skip to content

Commit

Permalink
CI: Fix creating / staging release (#2708)
Browse files Browse the repository at this point in the history
* Remove master branch checkout on creating release

* Correct fixes to build release tag workflow

* Clean up genbuild

* Remove all master ref tag

* Better rename

* Use git_version if env variable is set in genbuild

* Fix git version to build version

* Fix typo
  • Loading branch information
sieniven authored Nov 23, 2023
1 parent 7cf10dc commit 5a05dd2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 31 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Populate environment
run: ./make.sh ci-export-vars
Expand Down Expand Up @@ -57,8 +55,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Populate environment
run: ./make.sh ci-export-vars
Expand All @@ -80,8 +76,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Populate environment
run: ./make.sh ci-export-vars
Expand All @@ -103,8 +97,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Populate environment
run: ./make.sh ci-export-vars
Expand All @@ -126,8 +118,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Populate environment
run: ./make.sh ci-export-vars
Expand All @@ -153,8 +143,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Populate environment
run: ./make.sh ci-export-vars
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/build-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Populate environment
run: ./make.sh ci-export-vars
Expand All @@ -37,8 +35,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Populate environment
run: ./make.sh ci-export-vars
Expand All @@ -59,8 +55,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Populate environment
run: ./make.sh ci-export-vars
Expand All @@ -81,8 +75,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Populate environment
run: ./make.sh ci-export-vars
Expand All @@ -103,8 +95,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Populate environment
run: ./make.sh ci-export-vars
Expand Down Expand Up @@ -133,8 +123,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Populate environment
run: ./make.sh ci-export-vars
Expand Down
15 changes: 8 additions & 7 deletions contrib/genbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ git_check_in_repo() {
DESC=""
SUFFIX=""
CURRENT_BRANCH=""
if [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" ] && [ -e "$(command -v git)" ] && [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] && git_check_in_repo contrib/genbuild.sh; then
if [ -z "$BUILD_VERSION" ] && [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" ] && [ -e "$(command -v git)" ] && [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] && git_check_in_repo contrib/genbuild.sh; then
# clean 'dirty' status of touched files that haven't been modified
git diff >/dev/null 2>/dev/null

Expand All @@ -49,14 +49,15 @@ if [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" ] && [ -e "$(command -v git)" ] && [ "$
SUFFIX="$(echo $CURRENT_BRANCH | sed 's/\//-/g')-$SUFFIX"
fi

if [ "$CURRENT_BRANCH" != "hotfix" ] && [ "$CURRENT_BRANCH" != "master" ]; then
# if it's hotfix branch, don't mark dirty.
# otherwise generate suffix from git, i.e. string like "59887e8-dirty".
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty"
fi
# Check for changes in tracked files against the
# index/working tree, mark as dirty if changes
# are present.
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty"
fi

if [ -n "$DESC" ]; then
if [ -n "$BUILD_VERSION" ]; then
NEWINFO="#define BUILD_DESC \"$BUILD_VERSION\""
elif [ -n "$DESC" ]; then
NEWINFO="#define BUILD_DESC \"$DESC\""
elif [ -n "$SUFFIX" ]; then
NEWINFO="#define BUILD_SUFFIX $SUFFIX"
Expand Down

0 comments on commit 5a05dd2

Please sign in to comment.