From f9fab98f2dc4c92c048d5bd828ab5b4091f94a1e Mon Sep 17 00:00:00 2001 From: brianush1 Date: Fri, 4 Sep 2026 13:44:15 -0700 Subject: [PATCH] add automatic commit-level releases --- .github/actions/upload-to-github/action.yml | 22 ++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/actions/upload-to-github/action.yml b/.github/actions/upload-to-github/action.yml index bf8125ccfa..1c9f8d9410 100644 --- a/.github/actions/upload-to-github/action.yml +++ b/.github/actions/upload-to-github/action.yml @@ -9,7 +9,7 @@ runs: path: artifacts/ merge-multiple: true # place all files into artifacts/ directly - - name: Set GITHUB_RELEASE_TAG & ARTIFACT_ID + - name: Set GITHUB_RELEASE_TAG, VERSIONED_RELEASE_TAG & ARTIFACT_ID shell: bash run: | set -eux @@ -17,12 +17,15 @@ runs: tag='${{ github.ref }}' tag="${tag:10}" artifactID="${tag:1}" + versionedTag='' else tag=CI artifactID='${{ github.sha }}' + versionedTag="CI-${artifactID}" artifactID="${artifactID:0:8}" fi echo "GITHUB_RELEASE_TAG=$tag" >> $GITHUB_ENV + echo "VERSIONED_RELEASE_TAG=$versionedTag" >> $GITHUB_ENV echo "ARTIFACT_ID=$artifactID" >> $GITHUB_ENV - name: Download existing artifacts from GitHub release @@ -69,3 +72,20 @@ runs: omitDraftDuringUpdate: true # master builds: remove existing artifacts for 'CI' release removeArtifacts: ${{ env.GITHUB_RELEASE_TAG == 'CI' }} + + - name: Upload to versioned GitHub release + if: env.VERSIONED_RELEASE_TAG != '' + uses: ncipollo/release-action@v1 + with: + tag: ${{ env.VERSIONED_RELEASE_TAG }} + commit: ${{ github.sha }} + artifacts: artifacts/* + allowUpdates: true + artifactErrorsFailBuild: true + prerelease: true + omitPrereleaseDuringUpdate: true + omitName: true + omitBody: true + omitDraftDuringUpdate: true + # re-running CI for the same commit should refresh that commit's artifacts + removeArtifacts: true