diff --git a/.forgejo/workflows/generate-release-zipfile.yml b/.forgejo/workflows/generate-release-zipfile.yml new file mode 100644 index 0000000..ad27c9f --- /dev/null +++ b/.forgejo/workflows/generate-release-zipfile.yml @@ -0,0 +1,35 @@ +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 + + - name: Testing the artifact uploading + id: "uploading" + uses: "https://entrepot.xlii.si/actions/upload-artifact-with-wget@v4" + with: + path: | + toto + tutu* + + - 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 }}" diff --git a/.github b/.github new file mode 120000 index 0000000..0db043d --- /dev/null +++ b/.github @@ -0,0 +1 @@ +.forgejo/ \ No newline at end of file diff --git a/README.md b/README.md index 218cf00..76d2950 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,14 @@ the artifact uploading required a full blown NodeJS container. This actions won't copy all the features of the original NodeJS version but please report differences on the main ones. +### Requirements + +This action needs the following executables: + +* zip (unless you zip the artifact yourself) +* wget (the full version : unfortunately, as of 2024-08-26, the busybox variant isn't capable of using the PUT method) + + ### Inputs ```yaml @@ -45,3 +53,19 @@ steps: name: my-artifact path: path/to/artifact/world.txt ``` + +## Miscellaneous + +If you seek a similar alternative for checkout, look at https://github.com/marketplace/actions/checkout-action or use the code below : +```yaml +steps: + - name: Simple checkout + run: | + git init + GITHUB_AUTHENTICATED_URL="$( echo "$GITHUB_SERVER_URL" | sed "s#^\(https\?://\)#\1$GITHUB_TOKEN\@#" )" + git remote add origin "$GITHUB_AUTHENTICATED_URL"/"$GITHUB_REPOSITORY" + # Little and optional speed optimization + git config --local gc.auto 0 + git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin "$GITHUB_SHA" + git reset --hard "$GITHUB_SHA" +``` diff --git a/action.yml b/action.yml index 858b979..d676132 100644 --- a/action.yml +++ b/action.yml @@ -1,11 +1,11 @@ # SPDX-License-Identifier: 0BSD -name: "Upload artifact with wget" -author: "Chl " +name: "Upload an artifact with wget" +author: "Chl" description: | Upload an artifact for a workflow. - This is a far lighter version of upload-artifact, it only need a shell, zip + This is a lighter version of upload-artifact, it only needs a shell, zip and the full version of wget (unfortunately, as of 2024-08-26, the busybox variant isn't capable of using the PUT method). @@ -17,7 +17,7 @@ inputs: description: 'A file, directory or wildcard pattern that describes what to upload' required: true compression: - description: 'Set to false to upload the (already zipped) file directly. (default: true)' + description: 'Set to false to upload the (already zipped by yourself) file directly. (default: true)' default: true compression-level: description: 'The level of compression for Zlib to be applied to the artifact archive (between 0 and 9).'