Self CI/CD with download of the artifact
All checks were successful
/ GenerateReleaseZipfile (push) Successful in 1m10s
All checks were successful
/ GenerateReleaseZipfile (push) Successful in 1m10s
This commit is contained in:
parent
c2d7e3d9bc
commit
705e2d717c
3 changed files with 41 additions and 5 deletions
|
@ -23,7 +23,7 @@ jobs:
|
|||
|
||||
- name: Testing the artifact uploading
|
||||
id: "uploading"
|
||||
uses: "https://entrepot.xlii.si/actions/upload-artifact-with-wget@v4"
|
||||
uses: "${{ github.server_url }}/${{ github.repository }}@${{ github.sha }}"
|
||||
with:
|
||||
path: |
|
||||
toto
|
||||
|
@ -33,3 +33,32 @@ jobs:
|
|||
run: |
|
||||
set -x
|
||||
printf "steps.uploading.outputs.artifact-id: %s\n" "${{ steps.uploading.outputs.artifact-id }}"
|
||||
printf "steps.uploading.outputs.artifact-url: %s\n" "${{ steps.uploading.outputs.artifact-url }}"
|
||||
|
||||
- name: Check the content of the uploaded artifact
|
||||
run: |
|
||||
# Stop at first error and be verbose
|
||||
set -ex
|
||||
|
||||
# Create some temporary files/directory
|
||||
DOWNLOAD_FILE="$( mktemp )"
|
||||
SHASUM_FILE="$( mktemp )"
|
||||
TEST_ARTIFACT_DIR="$( mktemp -d )"
|
||||
|
||||
# Get the fingerprint of our test
|
||||
find . -type f -exec sha256sum \{\} \; > "$SHASUM_FILE"
|
||||
# Little optional checkup
|
||||
cat "$SHASUM_FILE"
|
||||
|
||||
cd "$TEST_ARTIFACT_DIR"
|
||||
# In case the repository becomes private, we add our GITHUB_TOKEN to the artifact-url.
|
||||
MY_AUTHENTICATED_URL="$( echo "${{ steps.uploading.outputs.artifact-url }}" | sed "s#^\(https\?://\)#\1$GITHUB_TOKEN\@#" )"
|
||||
wget -O "$DOWNLOAD_FILE" "$MY_AUTHENTICATED_URL"
|
||||
unzip "$DOWNLOAD_FILE"
|
||||
sha256sum -c "$SHASUM_FILE"
|
||||
|
||||
# Cleanup
|
||||
cd -
|
||||
rm -f "$DOWNLOAD_FILE"
|
||||
rm -f "$SHASUM_FILE"
|
||||
rm -rf "$TEST_ARTIFACT_DIR"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue