Skip to content

Commit

Permalink
wip on asset upload
Browse files Browse the repository at this point in the history
Former-commit-id: 57da2a7385b21ed7b63755fbf0188aa33995cf43
  • Loading branch information
greyltc authored Jan 13, 2022
1 parent a97fa56 commit 70abca9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,26 @@ jobs:
--header "Accept: application/vnd.github.v3+json" \
--data '{"draft":false,"tag_name":"v${{ env.THIS_VERSTRING }}","name":"Version ${{ env.THIS_VERSTRING }}"}' \
--output rel_resp.json
cat rel_resp.json | jq --raw-output '.'
cat rel_resp.json | jq --raw-output '.upload_url'
#cat rel_resp.json | jq --raw-output '.'
#cat rel_resp.json | jq --raw-output '.upload_url'
echo "Release Done."
RELEASE_ID=$(cat rel_resp.json | jq --raw-output '.id')
ASSET_UL_URL=$(cat rel_resp.json | jq --raw-output '.upload_url')
ASSET_UL_URL="https://uploads.github.com/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets"
ASSET_UL_URL="${ASSET_UL_URL}?name=$(basename ${ASSET_FILE})"
ASSET_UL_URL="${ASSET_UL_URL}&label=build_context"
echo ${ASSET_UL_URL}
#UL_URL=$(cat rel_resp.json | jq --raw-output '.upload_url' | sed "s|{?.*|?name=$(basename ${ASSET_FILE})&label=x86_64 Docker build context|g")
#UL_URL=$(cat rel_resp.json | jq --raw-output '.upload_url' | sed "s|{?.*|?name=$(basename ${ASSET_FILE})|g")
UL_URL=$(cat rel_resp.json | jq --raw-output '.upload_url' | sed "s|{?.*||g")
UL_URL
set -x
curl --verbose \
cat ${ASSET_FILE} | curl --verbose \
--url "${UL_URL}" \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header "Accept: application/vnd.github.v3+json" \
--header "Content-Type: $(file --brief --mime-type ${ASSET_FILE})" \
--get \
--data "name=docker-archlinux-x86_64.tar.xz" \
--request POST \
--data-binary @${ASSET_FILE} \
--data-raw - \
--output asset_resp.json
cat asset_resp.json | jq --raw-output '.'

0 comments on commit 70abca9

Please sign in to comment.