Skip to content

Commit

Permalink
fix: download/upload release artifacts from separate directory
Browse files Browse the repository at this point in the history
As part of the release build, ensures that the release artifacts
are downloaded into a separate directory and uploaded from there. Avoids
conflicts with other files that are created, e.g. by checking out
the repository

(cherry picked from commit 7e0d3d0)
  • Loading branch information
ThorbenLindhauer authored and github-actions[bot] committed Jun 3, 2024
1 parent 9a065d3 commit c4b8287
Showing 1 changed file with 29 additions and 27 deletions.
56 changes: 29 additions & 27 deletions .github/workflows/zeebe-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,32 +210,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Download Release Artifacts
uses: actions/download-artifact@v4
with:
name: release-artifacts-${{ inputs.releaseVersion }}
- name: Create Artifact Checksums
id: checksum
run: |
for filename in *; do
checksumFile="${filename}.sha1sum"
sha1sum "${filename}" > "${checksumFile}"
sha1sumResult=$?
if [ ! -f "${checksumFile}" ]; then
echo "Failed to created checksum of ${filename} at ${checksumFile}; [sha1sum] exited with result ${sha1sumResult}. Check the logs for errors."
exit 1
fi
done
- name: Determine if Pre-Release
id: pre-release
run: |
shopt -s nocasematch # set matching to case insensitive
PRE_RELEASE=false
if [[ "${RELEASE_VERSION}" =~ ^.*-(alpha|rc|SNAPSHOT)[\d]*$ ]]; then
PRE_RELEASE=true
fi
shopt -u nocasematch # reset it
echo "result=${PRE_RELEASE}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_BRANCH }}
Expand Down Expand Up @@ -301,12 +275,40 @@ jobs:
# To show the changelog also as step summary
echo "$changelog" >> $GITHUB_STEP_SUMMARY
- name: Download Release Artifacts
uses: actions/download-artifact@v4
with:
name: release-artifacts-${{ inputs.releaseVersion }}
path: release-artifacts
- name: Create Artifact Checksums
id: checksum
working-directory: ./release-artifacts
run: |
for filename in *; do
checksumFile="${filename}.sha1sum"
sha1sum "${filename}" > "${checksumFile}"
sha1sumResult=$?
if [ ! -f "${checksumFile}" ]; then
echo "Failed to created checksum of ${filename} at ${checksumFile}; [sha1sum] exited with result ${sha1sumResult}. Check the logs for errors."
exit 1
fi
done
- name: Determine if Pre-Release
id: pre-release
run: |
shopt -s nocasematch # set matching to case insensitive
PRE_RELEASE=false
if [[ "${RELEASE_VERSION}" =~ ^.*-(alpha|rc|SNAPSHOT)[\d]*$ ]]; then
PRE_RELEASE=true
fi
shopt -u nocasematch # reset it
echo "result=${PRE_RELEASE}" >> $GITHUB_OUTPUT
- name: Create Github release
uses: ncipollo/release-action@v1
if: ${{ inputs.dryRun == false }}
with:
name: ${{ inputs.releaseVersion }}
artifacts: "*"
artifacts: "release-artifacts/*"
artifactErrorsFailBuild: true
draft: true
body: ${{ steps.gen-changelog.outputs.changelog }}
Expand Down

0 comments on commit c4b8287

Please sign in to comment.