From 3263fcbbc4f2466040630201b994d5a234b59023 Mon Sep 17 00:00:00 2001 From: Vaclav Petras Date: Fri, 29 Apr 2022 14:23:04 -0400 Subject: [PATCH 1/2] CI: Add missing step id to release draft, pre-release, artifacts - Remove new from the name (yes, we are creating a new thing, but it is a draft which says enough). - To use step_id for asset upload, specify id for the create release step. - If the tag contains RC, mark the release a pre-release. - On failure, upload the created file to an artifact for workflow debugging and use of the files for the release. --- .../{create_new_release_draft.yml => create_release_draft.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{create_new_release_draft.yml => create_release_draft.yml} (100%) diff --git a/.github/workflows/create_new_release_draft.yml b/.github/workflows/create_release_draft.yml similarity index 100% rename from .github/workflows/create_new_release_draft.yml rename to .github/workflows/create_release_draft.yml From 3bfe1780288b07cbc4029205063310afc9b619e1 Mon Sep 17 00:00:00 2001 From: Vaclav Petras Date: Fri, 29 Apr 2022 21:10:56 -0400 Subject: [PATCH 2/2] Add the actual changes described, not just rename --- .github/workflows/create_release_draft.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create_release_draft.yml b/.github/workflows/create_release_draft.yml index a34eb128e79..7b684e1e03a 100644 --- a/.github/workflows/create_release_draft.yml +++ b/.github/workflows/create_release_draft.yml @@ -1,4 +1,4 @@ -name: Create new release draft +name: Create a release draft on: push: @@ -25,6 +25,7 @@ jobs: git diff --cached > core_modules_with_last_commit.patch - name: Create new release draft + id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -36,7 +37,7 @@ jobs: - First change - Second change draft: true - prerelease: false + prerelease: ${{ contains(github.ref, "RC") }} - name: Upload core_modules_with_last_commit.json file uses: actions/upload-release-asset@v1 @@ -57,3 +58,13 @@ jobs: asset_path: core_modules_with_last_commit.patch asset_name: core_modules_with_last_commit.patch asset_content_type: text/plain + + - name: On failure, make the created files available + uses: actions/upload-artifact@v3 + if: failure() + with: + name: artifacts + path: | + core_modules_with_last_commit.* + if-no-files-found: warn + retention-days: 10