shell scripting is delightful
This commit is contained in:
parent
d29d2129cb
commit
0f63361dd9
|
|
@ -6,7 +6,7 @@ jobs:
|
||||||
container:
|
container:
|
||||||
image: git.hswro.org/fleg/actions-experiments:latest
|
image: git.hswro.org/fleg/actions-experiments:latest
|
||||||
steps:
|
steps:
|
||||||
- uses: https://codeberg.org/fleg/light-actions/checkout@test12
|
- uses: https://codeberg.org/fleg/light-actions/checkout@test13
|
||||||
- run: cat README.md
|
- run: cat README.md
|
||||||
upload-artifact:
|
upload-artifact:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
|
@ -14,7 +14,7 @@ jobs:
|
||||||
image: git.hswro.org/fleg/actions-experiments:latest
|
image: git.hswro.org/fleg/actions-experiments:latest
|
||||||
steps:
|
steps:
|
||||||
- run: echo "test passed" > test.txt
|
- run: echo "test passed" > test.txt
|
||||||
- uses: https://codeberg.org/fleg/light-actions/upload-artifact@test12
|
- uses: https://codeberg.org/fleg/light-actions/upload-artifact@test13
|
||||||
with:
|
with:
|
||||||
path: test.txt
|
path: test.txt
|
||||||
artifact-name: test-artifact
|
artifact-name: test-artifact
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ runs:
|
||||||
ARTIFACT_BASE="${ACTIONS_RUNTIME_URL}_apis/pipelines/workflows/${GITHUB_RUN_ID}/artifacts?api-version=6.0-preview"
|
ARTIFACT_BASE="${ACTIONS_RUNTIME_URL}_apis/pipelines/workflows/${GITHUB_RUN_ID}/artifacts?api-version=6.0-preview"
|
||||||
FILE_SIZE_BYTES=$(wc -c < ${{ inputs.path }})
|
FILE_SIZE_BYTES=$(wc -c < ${{ inputs.path }})
|
||||||
FILE_SIZE_BYTES_MINUS_ONE=$(echo $FILE_SIZE_BYTES - 1 | bc)
|
FILE_SIZE_BYTES_MINUS_ONE=$(echo $FILE_SIZE_BYTES - 1 | bc)
|
||||||
|
FILE_MD5=$(md5sum ${{ inputs.path }} | cut -f1 -d" ")
|
||||||
RESOURCE_URL="$(
|
RESOURCE_URL="$(
|
||||||
curl \
|
curl \
|
||||||
-XPOST \
|
-XPOST \
|
||||||
|
|
@ -36,7 +37,7 @@ runs:
|
||||||
--header 'Content-Type: application/octet-stream' \
|
--header 'Content-Type: application/octet-stream' \
|
||||||
--header "x-tfs-filelength: ${FILE_SIZE_BYTES}" \
|
--header "x-tfs-filelength: ${FILE_SIZE_BYTES}" \
|
||||||
--header "content-length: ${FILE_SIZE_BYTES}" \
|
--header "content-length: ${FILE_SIZE_BYTES}" \
|
||||||
--header "x-actions-results-md5: $(md5sum ${{ inputs.path }})" \
|
--header "x-actions-results-md5: ${FILE_MD5}" \
|
||||||
--header "Content-Range: bytes 0-${FILE_SIZE_BYTES_MINUS_ONE}/${FILE_SIZE_BYTES}" \
|
--header "Content-Range: bytes 0-${FILE_SIZE_BYTES_MINUS_ONE}/${FILE_SIZE_BYTES}" \
|
||||||
--data-binary "@${{ inputs.path }}" \
|
--data-binary "@${{ inputs.path }}" \
|
||||||
"${RESOURCE_URL}?itemPath=${{ inputs.artifact-name }}/$(basename ${{ inputs.path }})"
|
"${RESOURCE_URL}?itemPath=${{ inputs.artifact-name }}/$(basename ${{ inputs.path }})"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue