1
1
name : Release
2
+ run-name : Build release ${{ inputs.release_version }} from branch ${{ inputs.checkout_ref }} by @${{ github.actor }}
2
3
3
4
env :
4
5
APPLICATION : " erigon"
5
6
BUILDER_IMAGE : " golang:1.22-bookworm"
6
- DOCKER_BASE_IMAGE : " debian:12.7 -slim"
7
+ DOCKER_BASE_IMAGE : " debian:12.8 -slim"
7
8
APP_REPO : " erigontech/erigon"
8
9
PACKAGE : " github.com/erigontech/erigon"
9
10
DOCKERHUB_REPOSITORY : " erigontech/erigon"
@@ -43,22 +44,26 @@ jobs:
43
44
name : Build Artifacts and multi-platform Docker image, publish draft of the Release Notes
44
45
45
46
steps :
46
- - name : Checkout git repository ${{ env.APP_REPO }}
47
+ - name : Checkout git repository ${{ env.APP_REPO }} reference ${{ inputs.checkout_ref }}
47
48
uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # # 4.1.7 release
48
49
with :
49
50
repository : ${{ env.APP_REPO }}
50
51
fetch-depth : 0
51
52
ref : ${{ inputs.checkout_ref }}
52
53
path : ' erigon'
53
54
54
- - name : Check if tag ${{ inputs.release_version }} already exists in case perform_release is set.
55
+ - name : Check if tag ${{ inputs.release_version }} already exists and create it in case perform_release is set.
55
56
if : ${{ (inputs.perform_release) && (inputs.release_version != '') }}
56
57
run : |
58
+ cd erigon
57
59
if git ls-remote --exit-code --quiet --tags origin '${{ inputs.release_version }}'; then
58
60
echo "ERROR: tag ${{ inputs.release_version }} exists and workflow is performing release. Exit."
59
61
exit 1
60
62
else
61
63
echo "OK: tag ${{ inputs.release_version }} does not exists. Proceeding."
64
+ git tag ${{ inputs.release_version }}
65
+ git push origin ${{ inputs.release_version }}
66
+ echo; echo "Git TAG ${{ inputs.release_version }} created and pushed."
62
67
fi
63
68
64
69
- name : Run some commands, get commit id
@@ -230,3 +235,26 @@ jobs:
230
235
--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>" \
231
236
${{ inputs.release_version }} \
232
237
*.tar.gz ${{ env.APPLICATION }}_${{ inputs.release_version }}_checksums.txt
238
+
239
+ In-case-of-failure :
240
+ name : " In case of failure: remove remote git tag pointing to the new version."
241
+ needs : [ build-release ]
242
+ if : always() && !contains(needs.build-release.result, 'success')
243
+ runs-on : ubuntu-22.04
244
+
245
+ steps :
246
+ - name : Checkout git repository ${{ env.APP_REPO }} reference ${{ inputs.checkout_ref }}
247
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # # 4.1.7 release
248
+ with :
249
+ repository : ${{ env.APP_REPO }}
250
+ fetch-depth : 0
251
+ ref : ${{ inputs.checkout_ref }}
252
+ path : ' erigon'
253
+
254
+ - name : Rollback - remove git tag ${{ inputs.release_version }}
255
+ if : ${{ (inputs.perform_release) && (inputs.release_version != '') }}
256
+ run : |
257
+ cd erigon
258
+ git push -d origin ${{ inputs.release_version }}
259
+
260
+
0 commit comments