Compare commits
3
Commits
v7.9.0
..
b30ba3e76b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b30ba3e76b | ||
|
|
a4583f2db0 | ||
|
|
a161670b86 |
@@ -311,17 +311,40 @@ jobs:
|
|||||||
surfer put --token ${{ secrets.CODE_DATACONTROLLER_IO }} --server code.datacontroller.io sasjsbuild/sasdocs/* /
|
surfer put --token ${{ secrets.CODE_DATACONTROLLER_IO }} --server code.datacontroller.io sasjsbuild/sasdocs/* /
|
||||||
|
|
||||||
- name: Upload assets to release
|
- name: Upload assets to release
|
||||||
|
env:
|
||||||
|
# Use the same ephemeral per-job Gitea Actions token that the
|
||||||
|
# "Create Empty Release" step uses for semantic-release. It is scoped
|
||||||
|
# to this repo and is granted write access via the workflow's
|
||||||
|
# `permissions:` block at the top of the file (see contents: write).
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
RELEASE_ID=`curl -k 'https://git.datacontroller.io/api/v1/repos/dc/dc/releases/latest?access_token=${{ secrets.RELEASE_TOKEN }}' | jq -r '.id'`
|
set -euo pipefail
|
||||||
RELEASE_BODY=`curl -k 'https://git.datacontroller.io/api/v1/repos/dc/dc/releases/latest?access_token=${{ secrets.RELEASE_TOKEN }}' | jq -r '.body'`
|
# Send the token via Authorization header rather than ?access_token=
|
||||||
# Update body
|
# (the query-string form is deprecated and leaks into access logs).
|
||||||
curl --data '{"draft": false,"body":"'"$RELEASE_BODY\n\nFor installation instructions, please visit https://docs.datacontroller.io/"'"}' -X PATCH --header 'Content-Type: application/json' -k https://git.datacontroller.io/api/v1/repos/dc/dc/releases/$RELEASE_ID?access_token=${{ secrets.RELEASE_TOKEN }}
|
AUTH_HEADER="Authorization: token ${GITEA_TOKEN}"
|
||||||
|
BASE="${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}"
|
||||||
|
|
||||||
|
RELEASE_JSON=$(curl -k --fail-with-body -sS -H "$AUTH_HEADER" "$BASE/releases/latest")
|
||||||
|
RELEASE_ID=$(echo "$RELEASE_JSON" | jq -r '.id')
|
||||||
|
RELEASE_BODY=$(echo "$RELEASE_JSON" | jq -r '.body')
|
||||||
|
|
||||||
|
# Update body (also confirms the token has contents:write on this repo)
|
||||||
|
curl -k --fail-with-body -sS -X PATCH \
|
||||||
|
-H "$AUTH_HEADER" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
--data "$(jq -n --arg body "$RELEASE_BODY"$'\n\nFor installation instructions, please visit https://docs.datacontroller.io/' \
|
||||||
|
'{draft:false, body:$body}')" \
|
||||||
|
"$BASE/releases/$RELEASE_ID"
|
||||||
|
|
||||||
# Upload assets
|
# Upload assets
|
||||||
URL="https://git.datacontroller.io/api/v1/repos/dc/dc/releases/$RELEASE_ID/assets?access_token=${{ secrets.RELEASE_TOKEN }}"
|
URL="$BASE/releases/$RELEASE_ID/assets"
|
||||||
curl -k $URL -F attachment=@frontend.zip
|
for f in frontend.zip \
|
||||||
curl -k $URL -F attachment=@sas/demostream_sas9.sas
|
sas/demostream_sas9.sas \
|
||||||
curl -k $URL -F attachment=@sas/viya.sas
|
sas/viya.sas \
|
||||||
curl -k $URL -F attachment=@sas/sasjs_server.json.zip
|
sas/sasjs_server.json.zip \
|
||||||
curl -k $URL -F attachment=@sas/sas9.sas
|
sas/sas9.sas \
|
||||||
curl -k $URL -F attachment=@sas/viya_noweb.sas
|
sas/viya_noweb.sas \
|
||||||
curl -k $URL -F attachment=@sas/viya_noweb.json
|
sas/viya_noweb.json; do
|
||||||
|
echo "Uploading $f ..."
|
||||||
|
curl -k --fail-with-body -sS -H "$AUTH_HEADER" "$URL" -F "attachment=@$f"
|
||||||
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user