diff --git a/.forgejo/workflows/generate-release-zipfile.yml b/.forgejo/workflows/generate-release-zipfile.yml index fd86592..f9cf767 100644 --- a/.forgejo/workflows/generate-release-zipfile.yml +++ b/.forgejo/workflows/generate-release-zipfile.yml @@ -21,24 +21,6 @@ jobs: echo ratata >> 'tutu tutu*.txt' ls -R - - name: little test - run: | - printf "url:\n%s\n%s\n%s\nThe end." \ - "${{ github.server_url }}" \ - "${{ github.repository }}" \ - "${{ github.sha }}" - printf "mytest: %s\n" "$MYTEST" - printf "mytest2: %s\n" "${{ github.env.MYTEST }}" - printf "shapr: %s\n" "$SHAPR" - printf "shagh: %s\n" "$SHAGH" - printf "FULL_URL: %s\n" "$FULL_URL" - env: - RELEVANT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} - SHAPR: ${{ github.event.pull_request.head.sha }} - SHAGH: ${{ github.event.pull_request.head.sha || github.sha }} - MYTEST: "${{ github.server_url }}/${{ github.repository }}@${{ github.env.RELEVANT_SHA }}" - FULL_URL: "${{ github.server_url }}/${{ github.repository }}@${{ github.sha }}" - - name: Testing the artifact uploading id: "uploading" uses: "${{ github.server_url }}/${{ github.repository }}@${{ github.sha }}" @@ -51,3 +33,30 @@ 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 + sha256sum . > "$SHASUM_FILE" + # Little optional checkup + cat "$SHASUM_FILE" + + cd "$TEST_ARTIFACT_DIR" + wget -O "$DOWNLOAD_FILE" "${{ steps.uploading.outputs.artifact-url }}" + unzip "$DOWNLOAD_FILE" + sha256 -c "$SHASUM_FILE" + + # Cleanup + cd - + rm -f "$DOWNLOAD_FILE" + rm -f "$SHASUM_FILE" + rm -rf "$TEST_ARTIFACT_DIR" diff --git a/action.yml b/action.yml index d676132..95e524f 100644 --- a/action.yml +++ b/action.yml @@ -91,7 +91,9 @@ runs: )" # Store the outputs - echo artifact-id="$( echo "$RESPONSE" | sed -n 's/.*"artifactId" *: *"\([^"]\+\)".*/\1/p' )" >> $GITHUB_OUTPUT + ARTIFACT_ID="$( echo "$RESPONSE" | sed -n 's/.*"artifactId" *: *"\([^"]\+\)".*/\1/p' )" + echo artifact-id="$ARTIFACT_ID" >> $GITHUB_OUTPUT + echo artifact-url="$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY"/actions/runs/"$GITHUB_RUN_ID"/artifacts/"$ARTIFACT_ID" >> $GITHUB_OUTPUT # Cleanup if [ "${{ inputs.compression }}" == "true" ]; then