Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f55222ee3a |
@@ -113,12 +113,46 @@ jobs:
|
|||||||
tar -czvf ps.ipam-${{ github.ref_name }}.tar.gz ps.ipam/
|
tar -czvf ps.ipam-${{ github.ref_name }}.tar.gz ps.ipam/
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
uses: actions/gitea-release-action@v1
|
env:
|
||||||
with:
|
GITEA_TOKEN: ${{ secrets.TOKEN }}
|
||||||
token: ${{ secrets.TOKEN }}
|
run: |
|
||||||
files: |
|
# Determine if this is a prerelease (contains hyphen like v1.0.0-beta)
|
||||||
ps.ipam-${{ github.ref_name }}.zip
|
PRERELEASE=false
|
||||||
ps.ipam-${{ github.ref_name }}.tar.gz
|
if [[ "${{ github.ref_name }}" == *-* ]]; then
|
||||||
title: Release ${{ github.ref_name }}
|
PRERELEASE=true
|
||||||
draft: false
|
fi
|
||||||
prerelease: ${{ contains(github.ref_name, '-') }}
|
|
||||||
|
# Create the release
|
||||||
|
RELEASE_RESPONSE=$(curl -s -X POST \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\": \"${{ github.ref_name }}\", \"name\": \"Release ${{ github.ref_name }}\", \"body\": \"Release ${{ github.ref_name }}\", \"draft\": false, \"prerelease\": ${PRERELEASE}}" \
|
||||||
|
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases")
|
||||||
|
|
||||||
|
echo "Release response: ${RELEASE_RESPONSE}"
|
||||||
|
|
||||||
|
# Extract release ID
|
||||||
|
RELEASE_ID=$(echo "${RELEASE_RESPONSE}" | jq -r '.id')
|
||||||
|
|
||||||
|
if [ "${RELEASE_ID}" == "null" ] || [ -z "${RELEASE_ID}" ]; then
|
||||||
|
echo "Failed to create release"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Created release with ID: ${RELEASE_ID}"
|
||||||
|
|
||||||
|
# Upload ZIP attachment
|
||||||
|
curl -s -X POST \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: multipart/form-data" \
|
||||||
|
-F "attachment=@ps.ipam-${{ github.ref_name }}.zip" \
|
||||||
|
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets"
|
||||||
|
|
||||||
|
# Upload tar.gz attachment
|
||||||
|
curl -s -X POST \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: multipart/form-data" \
|
||||||
|
-F "attachment=@ps.ipam-${{ github.ref_name }}.tar.gz" \
|
||||||
|
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets"
|
||||||
|
|
||||||
|
echo "Release created successfully with attachments"
|
||||||
|
|||||||
Reference in New Issue
Block a user