Finalization tryout...
All checks were successful
/ GenerateReleaseZipfile (push) Successful in 1m13s
All checks were successful
/ GenerateReleaseZipfile (push) Successful in 1m13s
This commit is contained in:
parent
31cfa7d900
commit
917b4170ee
2 changed files with 19 additions and 11 deletions
19
.github/workflows/generate-release-zipfile.yml
vendored
19
.github/workflows/generate-release-zipfile.yml
vendored
|
@ -4,8 +4,8 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
GenerateReleaseZipfile:
|
GenerateReleaseZipfile:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# To allow access to the artifact with the GITHUB_TOKEN at the last step
|
# Trying to help access to the artifact with the GITHUB_TOKEN at the last step but didn't help.
|
||||||
permissions: read-all
|
#permissions: read-all
|
||||||
steps:
|
steps:
|
||||||
- name: Generate some content
|
- name: Generate some content
|
||||||
run: |
|
run: |
|
||||||
|
@ -18,6 +18,7 @@ jobs:
|
||||||
echo tutu >> tutu.txt
|
echo tutu >> tutu.txt
|
||||||
echo tutuuuuu >> tutu2.txt
|
echo tutuuuuu >> tutu2.txt
|
||||||
echo tutuuuuu >> "tutu tutu.txt"
|
echo tutuuuuu >> "tutu tutu.txt"
|
||||||
|
# Github doesn't like special characters.
|
||||||
#echo ratata >> 'tutu tutu*.txt'
|
#echo ratata >> 'tutu tutu*.txt'
|
||||||
ls -R
|
ls -R
|
||||||
|
|
||||||
|
@ -36,6 +37,7 @@ jobs:
|
||||||
- name: Testing the artifact uploading
|
- name: Testing the artifact uploading
|
||||||
id: "uploading"
|
id: "uploading"
|
||||||
uses: ./myaction
|
uses: ./myaction
|
||||||
|
# For comparison
|
||||||
#uses: actions/upload-artifact@v4
|
#uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
|
@ -45,7 +47,7 @@ jobs:
|
||||||
- name: "Cleanup Github"
|
- name: "Cleanup Github"
|
||||||
run: rm -rvf myaction
|
run: rm -rvf myaction
|
||||||
|
|
||||||
- name: Is there any output for the previous step ?
|
- name: Is there any output for the uploading step ?
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
printf "steps.uploading.outputs.artifact-id: %s\n" "${{ steps.uploading.outputs.artifact-id }}"
|
printf "steps.uploading.outputs.artifact-id: %s\n" "${{ steps.uploading.outputs.artifact-id }}"
|
||||||
|
@ -79,10 +81,13 @@ jobs:
|
||||||
# - ...but we get redirect to Windows.net/Azure data warehouse which refuses GITHUB_TOKEN...
|
# - ...but we get redirect to Windows.net/Azure data warehouse which refuses GITHUB_TOKEN...
|
||||||
# -> so, if the api.github.com fails, we try to extract the redirect location and hit it without any header.
|
# -> so, if the api.github.com fails, we try to extract the redirect location and hit it without any header.
|
||||||
# ('beginning to wonder if Github's changing master to main was also a part of a plot to complexify our lives...)
|
# ('beginning to wonder if Github's changing master to main was also a part of a plot to complexify our lives...)
|
||||||
TMP_WGET_OUTPUT="$( mktemp )"
|
WGET_OUTPUT="$( wget -O "$DOWNLOAD_FILE" \
|
||||||
wget -O "$DOWNLOAD_FILE" --header "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/$GITHUB_REPOSITORY/actions/artifacts/${{ steps.uploading.outputs.artifact-id }}/zip" 2>"$TMP_WGET_OUTPUT" || (
|
--header "Authorization: Bearer $GITHUB_TOKEN" \
|
||||||
wget -O "$DOWNLOAD_FILE" "$( sed -n 's/^Location: \(.*\) \[following\]/\1/p' "$TMP_WGET_OUTPUT" | tail -n 1 )"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/actions/artifacts/${{ steps.uploading.outputs.artifact-id }}/zip" 2>&1 )" \
|
||||||
)
|
|| wget -O "$DOWNLOAD_FILE" \
|
||||||
|
"$( echo "$WGET_OUTPUT" | sed -n 's/^Location: \(.*\) \[following\]/\1/p' | tail -n 1 )"
|
||||||
|
|
||||||
|
# unzip and check
|
||||||
unzip "$DOWNLOAD_FILE"
|
unzip "$DOWNLOAD_FILE"
|
||||||
sha256sum -c "$SHASUM_FILE"
|
sha256sum -c "$SHASUM_FILE"
|
||||||
|
|
||||||
|
|
11
action.yml
11
action.yml
|
@ -36,13 +36,15 @@ runs:
|
||||||
steps:
|
steps:
|
||||||
# ACTIONS_RUNTIME_TOKEN is not yet available (2024-08) for composite actions on Github :
|
# ACTIONS_RUNTIME_TOKEN is not yet available (2024-08) for composite actions on Github :
|
||||||
# https://github.com/actions/runner/issues/3046
|
# https://github.com/actions/runner/issues/3046
|
||||||
- name: Expose GitHub Runtime
|
# Forgejo tries to download this remote action even if it's not needed :
|
||||||
if: env.ACTIONS_RUNTIME_TOKEN == ''
|
# uncomment if you want to run this action in Github.
|
||||||
uses: "https://github.com/crazy-max/ghaction-github-runtime@v3"
|
#- name: Expose GitHub Runtime
|
||||||
|
# if: env.ACTIONS_RUNTIME_TOKEN == ''
|
||||||
|
# uses: "https://github.com/crazy-max/ghaction-github-runtime@v3"
|
||||||
|
|
||||||
- name: Upload artifact (using v4)
|
- name: Upload artifact (using v4)
|
||||||
shell: sh
|
shell: sh
|
||||||
# id required for the outputs extraction
|
# id for reference in the outputs extraction
|
||||||
id: uploading
|
id: uploading
|
||||||
run: |
|
run: |
|
||||||
# Some optional help for debugging.
|
# Some optional help for debugging.
|
||||||
|
@ -117,6 +119,7 @@ runs:
|
||||||
ARTIFACT_ID="$( echo "$RESPONSE" | sed -n 's/.*"artifact_\?Id" *: *"\([^"]\+\)".*/\1/ip' )"
|
ARTIFACT_ID="$( echo "$RESPONSE" | sed -n 's/.*"artifact_\?Id" *: *"\([^"]\+\)".*/\1/ip' )"
|
||||||
echo artifact-id="$ARTIFACT_ID" >> $GITHUB_OUTPUT
|
echo artifact-id="$ARTIFACT_ID" >> $GITHUB_OUTPUT
|
||||||
if [ "$GITHUB_SERVER_URL" = "https://github.com" ]; then
|
if [ "$GITHUB_SERVER_URL" = "https://github.com" ]; then
|
||||||
|
# note: as an alternative, there is https://api.github.com/repos/OWNER/REPO/actions/artifacts/ARTIFACT_ID
|
||||||
echo artifact-url="$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY"/actions/runs/"$GITHUB_RUN_ID"/artifacts/"$ARTIFACT_ID" >> $GITHUB_OUTPUT
|
echo artifact-url="$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY"/actions/runs/"$GITHUB_RUN_ID"/artifacts/"$ARTIFACT_ID" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
# Gitea & Forgejo : github.run_number instead of github.run_id and name of the artifact instead of artifact_id
|
# Gitea & Forgejo : github.run_number instead of github.run_id and name of the artifact instead of artifact_id
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue