fixing error
This commit is contained in:
@@ -161,14 +161,34 @@ jobs:
|
|||||||
|
|
||||||
- name: Create Gitea release
|
- name: Create Gitea release
|
||||||
run: |
|
run: |
|
||||||
RELEASE_ID=$(curl -sf -X POST \
|
API="https://git.${{ secrets.DOMAIN }}/api/v1/repos/${{ secrets.REGISTRY_USER }}/etf-oglasi"
|
||||||
-H "Authorization: token ${{ secrets.GITEARELEASE_TOKEN }}" \
|
AUTH="Authorization: token ${{ secrets.GITEARELEASE_TOKEN }}"
|
||||||
|
|
||||||
|
HTTP_CODE=$(curl -s -o release.json -w "%{http_code}" -X POST \
|
||||||
|
-H "$AUTH" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\":\"${{ steps.version.outputs.tag }}\",\"target_commitish\":\"${{ github.sha }}\",\"name\":\"${{ steps.version.outputs.tag }}\",\"draft\":false,\"prerelease\":false}" \
|
-d "{\"tag_name\":\"${{ steps.version.outputs.tag }}\",\"target_commitish\":\"${{ github.sha }}\",\"name\":\"${{ steps.version.outputs.tag }}\",\"draft\":false,\"prerelease\":false}" \
|
||||||
"https://git.${{ secrets.DOMAIN }}/api/v1/repos/${{ secrets.REGISTRY_USER }}/etf-oglasi/releases" \
|
"$API/releases")
|
||||||
| node -pe "JSON.parse(require('fs').readFileSync(0,'utf8')).id")
|
|
||||||
|
|
||||||
curl -sf -X POST \
|
echo "HTTP $HTTP_CODE"
|
||||||
-H "Authorization: token ${{ secrets.GITEARELEASE_TOKEN }}" \
|
cat release.json
|
||||||
|
|
||||||
|
if [ "$HTTP_CODE" != "201" ]; then
|
||||||
|
echo "Failed to create release"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
RELEASE_ID=$(node -pe "JSON.parse(require('fs').readFileSync('release.json','utf8')).id")
|
||||||
|
|
||||||
|
HTTP_CODE=$(curl -s -o asset.json -w "%{http_code}" -X POST \
|
||||||
|
-H "$AUTH" \
|
||||||
-F "attachment=@${{ steps.apk.outputs.path }}" \
|
-F "attachment=@${{ steps.apk.outputs.path }}" \
|
||||||
"https://git.${{ secrets.DOMAIN }}/api/v1/repos/${{ secrets.REGISTRY_USER }}/etf-oglasi/releases/$RELEASE_ID/assets?name=${{ steps.apk.outputs.name }}"
|
"$API/releases/$RELEASE_ID/assets?name=${{ steps.apk.outputs.name }}")
|
||||||
|
|
||||||
|
echo "HTTP $HTTP_CODE"
|
||||||
|
cat asset.json
|
||||||
|
|
||||||
|
if [ "$HTTP_CODE" != "201" ]; then
|
||||||
|
echo "Failed to upload asset"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user