[CENNSO-1947] fix: Error indication report crash (#399) #134
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
release: | |
runs-on: self-hosted | |
steps: | |
- name: Clean the workspace | |
uses: docker://alpine | |
with: | |
args: /bin/sh -c "rm -rf /github/workspace/.* 2>/dev/null || rm -rf /github/workspace/*" | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Wait for build to succeed | |
uses: fountainhead/[email protected] | |
id: wait-for-build | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
checkName: conclude | |
ref: ${{ github.sha }} | |
timeoutSeconds: 6000 | |
- name: Fail if the build did not succeed | |
if: steps.wait-for-build.outputs.conclusion == 'failure' | |
run: exit 1 | |
# increase our chances of getting the artifacts on 1st try | |
- name: Delay | |
run: sleep 20 | |
# It may take some time for the workflow to finish and the artifacts to appear | |
# FIXME: https://github.com/dawidd6/action-download-artifact/issues/43 | |
- name: Get debug image name | |
uses: dawidd6/action-download-artifact@v2 | |
continue-on-error: true | |
id: download | |
with: | |
workflow: main.yaml | |
workflow_conclusion: success | |
commit: ${{github.sha}} | |
name: image-debug | |
# FIXME: no clean way to retry the action | |
- name: Delay | |
if: steps.download.outcome=='failure' | |
run: sleep 40 | |
- name: Retry download (1) | |
if: steps.download.outcome=='failure' | |
uses: dawidd6/action-download-artifact@v2 | |
continue-on-error: true | |
id: download1 | |
with: | |
workflow: main.yaml | |
workflow_conclusion: success | |
commit: ${{github.sha}} | |
name: image-debug | |
- name: Delay | |
if: steps.download1.outcome=='failure' | |
run: sleep 80 | |
- name: Retry download (2) | |
if: steps.download1.outcome=='failure' | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: main.yaml | |
workflow_conclusion: success | |
commit: ${{github.sha}} | |
name: image-debug | |
- name: Promote (retag) the debug image | |
env: | |
REGISTRY_LOGIN: ${{ secrets.QUAY_USER_ID }} | |
REGISTRY_PASSWORD: ${{ secrets.QUAY_TOKEN }} | |
run: | | |
# hack/retag-unexpire.sh quay.io travelping/upg source_tag dest_tag | |
hack/retag-unexpire.sh $(sed 's@/@ @;s/:/ /' image-debug.txt) "${GITHUB_REF##*/}_debug" | |
- name: Get release image name | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: main.yaml | |
workflow_conclusion: success | |
commit: ${{github.sha}} | |
name: image-release | |
- name: Promote (retag) the release image | |
env: | |
REGISTRY_LOGIN: ${{ secrets.QUAY_USER_ID }} | |
REGISTRY_PASSWORD: ${{ secrets.QUAY_TOKEN }} | |
run: | | |
# hack/retag-unexpire.sh quay.io travelping/upg source_tag dest_tag | |
hack/retag-unexpire.sh $(sed 's@/@ @;s/:/ /' image-release.txt) "${GITHUB_REF##*/}_release" | |
- name: Get dev release image name | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: main.yaml | |
workflow_conclusion: success | |
commit: ${{github.sha}} | |
name: image-dev-release | |
- name: Promote (retag) the dev release image | |
env: | |
REGISTRY_LOGIN: ${{ secrets.QUAY_USER_ID }} | |
REGISTRY_PASSWORD: ${{ secrets.QUAY_TOKEN }} | |
run: | | |
hack/retag-unexpire.sh $(sed 's@/@ @;s/:/ /' image-dev-release.txt) "${GITHUB_REF##*/}_dev_release" | |
- name: Get dev debug image name | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: main.yaml | |
workflow_conclusion: success | |
commit: ${{github.sha}} | |
name: image-dev-debug | |
- name: Promote (retag) the dev debug image | |
env: | |
REGISTRY_LOGIN: ${{ secrets.QUAY_USER_ID }} | |
REGISTRY_PASSWORD: ${{ secrets.QUAY_TOKEN }} | |
run: | | |
hack/retag-unexpire.sh $(sed 's@/@ @;s/:/ /' image-dev-debug.txt) "${GITHUB_REF##*/}_dev_debug" | |
- name: Build Changelog | |
id: build_changelog | |
uses: mikepenz/release-changelog-builder-action@v1 | |
if: ${{ !contains(github.ref, 'test') }} | |
with: | |
configuration: "changelog-config.json" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Post the release | |
uses: softprops/action-gh-release@v1 | |
# TODO: prerelease for 'pre' | |
# TODO: no release for 'test' | |
if: ${{ !contains(github.ref, 'test') }} | |
with: | |
body: ${{ steps.build_changelog.outputs.changelog }} | |
prerelease: ${{ contains(github.ref, 'pre') }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |