Skip to content

Commit

Permalink
Cherry pick PR12658 & PR12721 form release/2.60 (#12807)
Browse files Browse the repository at this point in the history
  • Loading branch information
lystopad authored Nov 20, 2024
1 parent 2148546 commit 9dc3435
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
34 changes: 31 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Release
run-name: Build release ${{ inputs.release_version }} from branch ${{ inputs.checkout_ref }} by @${{ github.actor }}

env:
APPLICATION: "erigon"
BUILDER_IMAGE: "golang:1.22-bookworm"
DOCKER_BASE_IMAGE: "debian:12.7-slim"
DOCKER_BASE_IMAGE: "debian:12.8-slim"
APP_REPO: "erigontech/erigon"
PACKAGE: "github.com/erigontech/erigon"
DOCKERHUB_REPOSITORY: "erigontech/erigon"
Expand Down Expand Up @@ -43,22 +44,26 @@ jobs:
name: Build Artifacts and multi-platform Docker image, publish draft of the Release Notes

steps:
- name: Checkout git repository ${{ env.APP_REPO }}
- name: Checkout git repository ${{ env.APP_REPO }} reference ${{ inputs.checkout_ref }}
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 ## 4.1.7 release
with:
repository: ${{ env.APP_REPO }}
fetch-depth: 0
ref: ${{ inputs.checkout_ref }}
path: 'erigon'

- name: Check if tag ${{ inputs.release_version }} already exists in case perform_release is set.
- name: Check if tag ${{ inputs.release_version }} already exists and create it in case perform_release is set.
if: ${{ (inputs.perform_release) && (inputs.release_version != '') }}
run: |
cd erigon
if git ls-remote --exit-code --quiet --tags origin '${{ inputs.release_version }}'; then
echo "ERROR: tag ${{ inputs.release_version }} exists and workflow is performing release. Exit."
exit 1
else
echo "OK: tag ${{ inputs.release_version }} does not exists. Proceeding."
git tag ${{ inputs.release_version }}
git push origin ${{ inputs.release_version }}
echo; echo "Git TAG ${{ inputs.release_version }} created and pushed."
fi
- name: Run some commands, get commit id
Expand Down Expand Up @@ -230,3 +235,26 @@ jobs:
--notes "**Improvements:**<br>- ...coming soon <br><br>**Bugfixes:**<br><br>- ...coming soon<br><br>**Docker images:**<br><br>Docker image released:<br> ${{ env.DOCKER_TAGS }}<br><br>... coming soon<br>" \
${{ inputs.release_version }} \
*.tar.gz ${{ env.APPLICATION }}_${{ inputs.release_version }}_checksums.txt
In-case-of-failure:
name: "In case of failure: remove remote git tag pointing to the new version."
needs: [ build-release ]
if: always() && !contains(needs.build-release.result, 'success')
runs-on: ubuntu-22.04

steps:
- name: Checkout git repository ${{ env.APP_REPO }} reference ${{ inputs.checkout_ref }}
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 ## 4.1.7 release
with:
repository: ${{ env.APP_REPO }}
fetch-depth: 0
ref: ${{ inputs.checkout_ref }}
path: 'erigon'

- name: Rollback - remove git tag ${{ inputs.release_version }}
if: ${{ (inputs.perform_release) && (inputs.release_version != '') }}
run: |
cd erigon
git push -d origin ${{ inputs.release_version }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DOCKER := $(shell command -v docker 2> /dev/null)

GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
GIT_TAG ?= $(shell git describe --tags '--match=v*' --dirty)
GIT_TAG ?= $(shell git describe --tags '--match=*.*.*' --abbrev=7 --dirty)
ERIGON_USER ?= erigon
# if using volume-mounting data dir, then must exist on host OS
DOCKER_UID ?= $(shell id -u)
Expand Down

0 comments on commit 9dc3435

Please sign in to comment.