Compare commits
3 Commits
develop
...
283fd7a703
| Author | SHA1 | Date | |
|---|---|---|---|
| 283fd7a703 | |||
| 7b9d229289 | |||
| 88e4e12e3d |
@@ -113,46 +113,12 @@ 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
|
||||||
env:
|
uses: actions/gitea-release-action@v1
|
||||||
GITEA_TOKEN: ${{ secrets.TOKEN }}
|
with:
|
||||||
run: |
|
token: ${{ secrets.TOKEN }}
|
||||||
# Determine if this is a prerelease (contains hyphen like v1.0.0-beta)
|
files: |
|
||||||
PRERELEASE=false
|
ps.ipam-${{ github.ref_name }}.zip
|
||||||
if [[ "${{ github.ref_name }}" == *-* ]]; then
|
ps.ipam-${{ github.ref_name }}.tar.gz
|
||||||
PRERELEASE=true
|
title: Release ${{ github.ref_name }}
|
||||||
fi
|
draft: false
|
||||||
|
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