develop #18
@@ -55,22 +55,32 @@ jobs:
|
||||
run: |
|
||||
TAG="${{ steps.tag.outputs.tag }}"
|
||||
API="${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases"
|
||||
TOKEN="${{ gitea.token }}"
|
||||
|
||||
echo "=== Creating release $TAG ==="
|
||||
RESP=$(curl -s -X POST \
|
||||
-H "Authorization: token ${{ gitea.token }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"${TAG}\",\"name\":\"DataRouter ${TAG}\"}" \
|
||||
"$API")
|
||||
# Check if release already exists
|
||||
echo "=== Checking existing releases for $TAG ==="
|
||||
EXISTING=$(curl -s -H "Authorization: token ${TOKEN}" "${API}" | \
|
||||
python3 -c "import sys,json;rels=json.load(sys.stdin);print(next((r['id'] for r in rels if r['tag_name']=='${TAG}'),''))")
|
||||
|
||||
ID=$(echo "$RESP" | python3 -c "import sys,json;print(json.load(sys.stdin)['id'])")
|
||||
if [ -n "$EXISTING" ]; then
|
||||
ID="$EXISTING"
|
||||
echo "Release already exists (ID=$ID), updating it"
|
||||
else
|
||||
echo "=== Creating release $TAG ==="
|
||||
RESP=$(curl -s -X POST \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"${TAG}\",\"name\":\"DataRouter ${TAG}\"}" \
|
||||
"$API")
|
||||
ID=$(echo "$RESP" | python3 -c "import sys,json;d=json.loads(sys.stdin.read());print(d['id'])")
|
||||
fi
|
||||
|
||||
for dir in dist/*/; do
|
||||
name="$(basename "$dir").tar.gz"
|
||||
tar czf "/tmp/$name" -C "$dir" .
|
||||
echo "Uploading $name"
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${{ gitea.token }}" \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @"/tmp/$name" \
|
||||
"${API}/${ID}/assets?name=${name}"
|
||||
|
||||
Generated
-1
@@ -2,7 +2,6 @@
|
||||
<project version="4">
|
||||
<component name="CidrCTestProjectState">
|
||||
<ctestState>
|
||||
<lineNumber testId="path:CMakeLists.txt test:datarouter" value="28" />
|
||||
<lineNumber testId="path:null test:datarouter" value="28" />
|
||||
</ctestState>
|
||||
</component>
|
||||
|
||||
Reference in New Issue
Block a user