2024-08-29 02:14:55 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
GenerateReleaseZipfile:
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
|
|
|
image: entrepot.xlii.si/actions/alpine-wget-git-zip:latest
|
|
|
|
steps:
|
|
|
|
- name: Generate some content
|
|
|
|
run: |
|
|
|
|
set -ex
|
|
|
|
mkdir toto
|
|
|
|
echo tata > toto/tata.txt
|
|
|
|
echo titi > toto/titi.txt
|
|
|
|
echo titi titi > "toto/titi titi.txt"
|
|
|
|
echo tutu > tutu.txt
|
|
|
|
echo tutu >> tutu.txt
|
|
|
|
echo tutuuuuu >> tutu2.txt
|
|
|
|
echo tutuuuuu >> "tutu tutu.txt"
|
|
|
|
echo ratata >> 'tutu tutu*.txt'
|
|
|
|
ls -R
|
|
|
|
|
2024-08-29 02:57:50 +02:00
|
|
|
- name: Testing the artifact uploading
|
|
|
|
id: "uploading"
|
|
|
|
uses: "${{ github.server_url }}/${{ github.repository }}@${{ github.sha }}"
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
toto
|
|
|
|
tutu*
|
2024-08-29 02:14:55 +02:00
|
|
|
|
|
|
|
- name: Is there any output for the previous step ?
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
printf "steps.uploading.outputs.artifact-id: %s\n" "${{ steps.uploading.outputs.artifact-id }}"
|
2024-08-29 03:16:08 +02:00
|
|
|
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
|
2024-08-29 03:21:57 +02:00
|
|
|
find . -type f -exec sha256sum \{\} \; > "$SHASUM_FILE"
|
2024-08-29 03:16:08 +02:00
|
|
|
# Little optional checkup
|
|
|
|
cat "$SHASUM_FILE"
|
|
|
|
|
|
|
|
cd "$TEST_ARTIFACT_DIR"
|
2024-08-29 03:55:23 +02:00
|
|
|
# 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"
|
2024-08-29 03:16:08 +02:00
|
|
|
unzip "$DOWNLOAD_FILE"
|
2024-08-29 03:48:05 +02:00
|
|
|
sha256sum -c "$SHASUM_FILE"
|
2024-08-29 03:16:08 +02:00
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
cd -
|
|
|
|
rm -f "$DOWNLOAD_FILE"
|
|
|
|
rm -f "$SHASUM_FILE"
|
|
|
|
rm -rf "$TEST_ARTIFACT_DIR"
|