Compare commits
13 Commits
5fc0227a47
...
e6ca247176
| Author | SHA1 | Date |
|---|---|---|
|
|
e6ca247176 | |
|
|
ade9dc7611 | |
|
|
0f63361dd9 | |
|
|
d29d2129cb | |
|
|
22a20ce877 | |
|
|
75afc4c4b8 | |
|
|
81236347bb | |
|
|
baa2be8410 | |
|
|
f2ed70e4cc | |
|
|
957aeaaeff | |
|
|
7efa3470c6 | |
|
|
29dccddd38 | |
|
|
714f8a33a2 |
|
|
@ -6,7 +6,7 @@ jobs:
|
|||
container:
|
||||
image: git.hswro.org/fleg/actions-experiments:latest
|
||||
steps:
|
||||
- uses: https://codeberg.org/fleg/light-actions/checkout@test2
|
||||
- uses: https://codeberg.org/fleg/light-actions/checkout@test15
|
||||
- run: cat README.md
|
||||
upload-artifact:
|
||||
runs-on: docker
|
||||
|
|
@ -14,7 +14,7 @@ jobs:
|
|||
image: git.hswro.org/fleg/actions-experiments:latest
|
||||
steps:
|
||||
- run: echo "test passed" > test.txt
|
||||
- uses: https://codeberg.org/fleg/light-actions/upload-artifact@test2
|
||||
- uses: https://codeberg.org/fleg/light-actions/upload-artifact@test15
|
||||
with:
|
||||
path: test.txt
|
||||
artifact-name: test-artifact
|
||||
|
|
|
|||
|
|
@ -13,27 +13,32 @@ runs:
|
|||
- run: |
|
||||
set -euxo pipefail
|
||||
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_MINUS_ONE=$(echo $FILE_SIZE_BYTES - 1 | bc)
|
||||
FILE_MD5=$(md5sum ${{ inputs.path }} | cut -f1 -d" ")
|
||||
RESOURCE_URL="$(
|
||||
curl \
|
||||
-XPOST \
|
||||
--silent \
|
||||
--fail-with-body \
|
||||
--header "Authorization: Bearer ${{ github.token }}" \
|
||||
--header 'Accept: application/json;api-version=6.0-preview' \
|
||||
--header \"Authorization: Bearer ${ACTIONS_RUNTIME_TOKEN}\" \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{\"type\": \"actions_storage\", \"name\": \"${{ inputs.artifact-name }}\"}' \
|
||||
\"$ARTIFACT_BASE\" | jq --exit-status --raw-output .fileContainerResourceUrl
|
||||
--data '{"type": "actions_storage", "name": "${{ inputs.artifact-name }}"}' \
|
||||
$ARTIFACT_BASE | jq --exit-status --raw-output .fileContainerResourceUrl
|
||||
)"
|
||||
|
||||
curl \
|
||||
-XPUT \
|
||||
--silent \
|
||||
--fail-with-body \
|
||||
--header 'Accept: application/json;api-version=6.0-preview' \
|
||||
--header \"Authorization: Bearer ${ACTIONS_RUNTIME_TOKEN}\" \
|
||||
--header "Authorization: Bearer ${{ github.token }}" \
|
||||
--header 'Content-Type: application/octet-stream' \
|
||||
--header "Content-Range: bytes 0-$(echo \"$(wc -c < ${{ inputs.path }}) - 1 | wc")/$(wc -c < ${{ inputs.path }})" \
|
||||
--data-binary "@${{ inputs.path }}" \
|
||||
--header "x-tfs-filelength: ${FILE_SIZE_BYTES}" \
|
||||
--header "content-length: ${FILE_SIZE_BYTES}" \
|
||||
--header "x-actions-results-md5: ${FILE_MD5}" \
|
||||
--header "Content-Range: bytes 0-${FILE_SIZE_BYTES_MINUS_ONE}/${FILE_SIZE_BYTES}" \
|
||||
--data-binary @${{ inputs.path }} \
|
||||
"${RESOURCE_URL}?itemPath=${{ inputs.artifact-name }}/$(basename ${{ inputs.path }})"
|
||||
|
||||
curl \
|
||||
|
|
@ -41,8 +46,7 @@ runs:
|
|||
--silent \
|
||||
--fail-with-body \
|
||||
--header 'Accept: application/json;api-version=6.0-preview' \
|
||||
--header \"Authorization: Bearer ${ACTIONS_RUNTIME_TOKEN}\" \
|
||||
--header "Authorization: Bearer ${{ github.token }}" \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{"size": 11}' \
|
||||
"${ARTIFACT_BASE}&artifactName=${{ inputs.artifact-name }}"
|
||||
shell: sh
|
||||
|
|
|
|||
Loading…
Reference in New Issue