5353 parsed-version : ${{ steps.getCommitId.outputs.parsed_version}}
5454
5555 steps :
56+
57+ - name : Cleanup working directory
58+ run : rm -drfv *
59+
5660 - name : Checkout git repository ${{ env.APP_REPO }} reference ${{ inputs.checkout_ref }}
5761 uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # # 4.1.7 release
5862 with :
@@ -197,250 +201,5 @@ jobs:
197201 compression-level : 0
198202 if-no-files-found : error
199203
200-
201- test-release :
202- name : test on ${{ matrix.id }}
203- runs-on : [ self-hosted, Release, "${{ matrix.runner-arch }}" ]
204- timeout-minutes : 7200 # 5 days
205- needs : [ build-release ]
206- strategy :
207- matrix :
208- include :
209- - id : linux/amd64
210- runner-arch : X64
211- artifact : linux_amd64
212- - id : linux/arm64
213- runner-arch : ARM64
214- artifact : linux_arm64
215-
216- steps :
217-
218204 - name : Cleanup working directory
219205 run : rm -drfv *
220-
221- - name : Set up Python
222- uses : actions/setup-python@v5
223- with :
224- python-version : ' 3.12'
225-
226- - name : Download artifact ${{ env.APPLICATION }}_${{ inputs.release_version }}_${{ matrix.artifact }}.tar.gz
227- uses : actions/download-artifact@v4
228- with :
229- name : ${{ env.APPLICATION }}_${{ inputs.release_version }}_${{ matrix.artifact }}.tar.gz
230- path : .
231-
232- - name : Extract artifact ${{ env.APPLICATION }}_${{ inputs.release_version }}_${{ matrix.artifact }}.tar.gz
233- run : |
234- pwd
235- ls -l ${{ env.APPLICATION }}_${{ inputs.release_version }}_${{ matrix.artifact }}.tar.gz
236- tar xzvf ${{ env.APPLICATION }}_${{ inputs.release_version }}_${{ matrix.artifact }}.tar.gz
237- ls -lR
238- - name : Fast checkout git repository erigontech/erigon-qa
239- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # # 4.1.7 release
240- with :
241- token : ${{ secrets.ORG_GITHUB_ERIGONTECH_ERIGON_QA_READ }}
242- repository : erigontech/erigon-qa
243- fetch-depth : 1
244- ref : main
245- path : erigon-qa
246-
247- - name : Checkout QA Tests Repository & Install Requirements
248- run : |
249- cd ./erigon-qa/test_system
250- pwd
251- ls -lao
252- pip3 install -r requirements.txt
253- ln -s $(pwd)/base_library $(pwd)/qa-tests/tip-tracking/base_library
254- echo "DEBUG -- content of directory $(pwd) :"
255- ls -l
256- echo "DEBUG -- content of directory $(pwd)/qa-tests/tip-tracking/"
257- ls -l $(pwd)/qa-tests/tip-tracking/
258- echo "DEBUG -- content of directory GITHUB_WORKSPACE ${GITHUB_WORKSPACE} :"
259- ls -l ${GITHUB_WORKSPACE}
260- echo "DEBUG -- end."
261- rm -rf ${RUNNER_WORKSPACE}/erigon-data || true
262- mkdir ${RUNNER_WORKSPACE}/erigon-data
263- # Run Erigon, wait sync and check ability to maintain sync
264- python3 qa-tests/tip-tracking/run_and_check_tip_tracking.py \
265- ${GITHUB_WORKSPACE}/${{ env.APPLICATION }}_${{ inputs.release_version }}_${{ matrix.artifact }} \
266- ${RUNNER_WORKSPACE}/erigon-data ${{ env.TEST_TRACKING_TIME_SECONDS }} ${{ env.TEST_TOTAL_TIME_SECONDS }} ${{ env.APPLICATION_VERSION }} ${{ env.TEST_CHAIN }}
267- # Capture monitoring script exit status
268- test_exit_status=$?
269- # Save the subsection reached status
270- echo "::set-output name=test_executed::true"
271- # Check test runner script exit status
272- if [ $test_exit_status -eq 0 ]; then
273- echo "Tests completed successfully"
274- echo "TEST_RESULT=success" >> "$GITHUB_OUTPUT"
275- else
276- echo "Error detected during tests"
277- echo "TEST_RESULT=failure" >> "$GITHUB_OUTPUT"
278- fi
279-
280- - name : Cleanup working directory
281- run : rm -drfv *
282-
283- build-debian-pkg :
284- name : Debian packages
285- needs : [ build-release, test-release ]
286- uses : erigontech/erigon/.github/workflows/reusable-release-build-debian-pkg.yml@main
287- with :
288- application : ${{ needs.build-release.outputs.application }}
289- version : ${{ needs.build-release.outputs.parsed-version }}
290-
291-
292- publish-docker-image :
293- needs : [ build-release, test-release ]
294- runs-on : ubuntu-latest
295- timeout-minutes : 30
296- name : Docker image
297-
298- steps :
299-
300- - name : Fast checkout just ${{ env.DOCKERFILE_PATH }} from git repository ${{ env.APP_REPO }}
301- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # # 4.1.7 release
302- with :
303- repository : ${{ env.APP_REPO }}
304- sparse-checkout : ${{ env.DOCKERFILE_PATH }}
305- sparse-checkout-cone-mode : false
306- ref : ${{ needs.build-release.outputs.commit-id }}
307-
308- - name : Download arm64 artifact
309- uses : actions/download-artifact@v4
310- with :
311- name : ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_arm64.tar.gz
312-
313- - name : Download amd64 artifact
314- uses : actions/download-artifact@v4
315- with :
316- name : ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64.tar.gz
317-
318- - name : Download amd64v2 artifact
319- uses : actions/download-artifact@v4
320- with :
321- name : ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64v2.tar.gz
322-
323- - name : Set up QEMU
324- uses : docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # # v3.2.0
325-
326- - name : Set up Docker Buildx
327- uses : docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # # v3.6.1
328-
329- - name : Login to Docker Hub
330- uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # # v3.3.0
331- with :
332- username : ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_USERNAME }}
333- password : ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_TOKEN }}
334-
335- - name : Build and push multi-platform docker images (${{ env.BUILD_VERSION }} and maybe latest) in case perform_release is true
336- if : ${{ inputs.perform_release }}
337- env :
338- BUILD_VERSION : ${{ inputs.release_version }}
339- DOCKER_URL : ${{ env.DOCKERHUB_REPOSITORY }}
340- DOCKER_PUBLISH_LATEST_CONDITION : ${{ inputs.publish_latest_tag && format('--tag {0}:latest ',env.DOCKERHUB_REPOSITORY) || '' }}
341- run : |
342- pwd
343- find . -ls
344- docker buildx build \
345- --file ${{ env.DOCKERFILE_PATH }} \
346- --build-arg RELEASE_DOCKER_BASE_IMAGE=${{ env.DOCKER_BASE_IMAGE }} \
347- --build-arg VERSION=${{ env.BUILD_VERSION }} \
348- --build-arg APPLICATION=${{ env.APPLICATION }} \
349- --tag ${{ env.DOCKER_URL }}:${{ env.BUILD_VERSION }} \
350- --target release \
351- --attest type=provenance,mode=max \
352- --sbom=true \
353- ${{ env.DOCKER_PUBLISH_LATEST_CONDITION }} \
354- --label org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
355- --label org.opencontainers.image.authors="https://github.com/erigontech/erigon/graphs/contributors" \
356- --label org.opencontainers.image.url="https://github.com/erigontech/erigon/blob/${{ inputs.checkout_ref }}/${{ env.DOCKERFILE_PATH }}" \
357- --label org.opencontainers.image.documentation="https://github.com/erigontech/erigon/blob/${{ inputs.checkout_ref }}/${{ env.DOCKERFILE_PATH }}" \
358- --label org.opencontainers.image.source="https://github.com/erigontech/erigon/blob/${{ inputs.checkout_ref }}/${{ env.DOCKERFILE_PATH }}" \
359- --label org.opencontainers.image.version=${{ inputs.release_version }} \
360- --label org.opencontainers.image.revision=${{ needs.build-release.outputs.commit-id }} \
361- --label org.opencontainers.image.vcs-ref-short=${{ needs.build-release.outputs.short-commit-id }} \
362- --label org.opencontainers.image.vendor="${{ github.repository_owner }}" \
363- --label org.opencontainers.image.description="${{ env.LABEL_DESCRIPTION }}" \
364- --label org.opencontainers.image.base.name="${{ env.DOCKER_BASE_IMAGE }}" \
365- --push \
366- --platform linux/amd64,linux/amd64/v2,linux/arm64 .
367-
368-
369-
370- publish-release :
371- needs : [ build-debian-pkg, publish-docker-image, build-release ]
372- runs-on : ubuntu-latest
373- timeout-minutes : 15
374- name : Publish release notes
375-
376- steps :
377- - name : Download linux/arm64 artifact
378- uses : actions/download-artifact@v4
379- with :
380- name : ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_arm64.tar.gz
381- path : dist/
382-
383- - name : Download linux/amd64 artifact
384- uses : actions/download-artifact@v4
385- with :
386- name : ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64.tar.gz
387- path : dist/
388-
389- - name : Download linux/amd64v2 artifact
390- uses : actions/download-artifact@v4
391- with :
392- name : ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64v2.tar.gz
393- path : dist/
394-
395- - name : Download arm64 debian package
396- uses : actions/download-artifact@v4
397- with :
398- name : ${{ env.APPLICATION }}_${{ needs.build-release.outputs.parsed-version }}_arm64.deb
399- path : dist/
400-
401- - name : Download amd64 debian package
402- uses : actions/download-artifact@v4
403- with :
404- name : ${{ env.APPLICATION }}_${{ needs.build-release.outputs.parsed-version }}_amd64.deb
405- path : dist/
406-
407- - name : Publish draft of the Release notes with assets in case perform_release is set
408- if : ${{ inputs.perform_release }}
409- env :
410- GH_TOKEN : ${{ github.token }}
411- GH_REPO : ${{ github.repository }}
412- DOCKER_TAGS : ${{ env.DOCKERHUB_REPOSITORY }}:${{ inputs.release_version }}
413- GITHUB_RELEASE_TARGET : ${{ inputs.checkout_ref }}
414- run : |
415- cd dist
416- sha256sum *.tar.gz *.deb > ${HOME}/${{ env.APPLICATION }}_${{ inputs.release_version }}_checksums.txt
417- gh release create \
418- --generate-notes \
419- --target ${GITHUB_RELEASE_TARGET} \
420- --draft=true \
421- --title "${{ inputs.release_version }}" \
422- --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>" \
423- "${{ inputs.release_version }}" \
424- *.tar.gz *.deb ${HOME}/${{ env.APPLICATION }}_${{ inputs.release_version }}_checksums.txt
425-
426-
427- In-case-of-failure :
428- name : " In case of failure: remove remote git tag pointing to the new version."
429- needs : [ publish-release, build-release, test-release ]
430- if : always() && !contains(needs.build-release.result, 'success')
431- runs-on : ubuntu-22.04
432-
433- steps :
434- - name : Checkout git repository ${{ env.APP_REPO }} reference ${{ inputs.checkout_ref }}
435- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # # 4.1.7 release
436- with :
437- repository : ${{ env.APP_REPO }}
438- fetch-depth : 0
439- ref : ${{ inputs.checkout_ref }}
440- path : ' erigon'
441-
442- - name : Rollback - remove git tag ${{ inputs.release_version }}
443- if : ${{ (inputs.perform_release) && (inputs.release_version != '') }}
444- run : |
445- cd erigon
446- git push -d origin ${{ inputs.release_version }}
0 commit comments