chore: update pipeline to manual releases
This commit is contained in:
parent
7564ce01d5
commit
3a09c4d638
1 changed files with 33 additions and 9 deletions
|
|
@ -59,12 +59,36 @@ jobs:
|
|||
cp result-musl/bin/streamd release/streamd-${{ steps.version.outputs.VERSION }}-linux-x86_64
|
||||
|
||||
- name: Create release
|
||||
uses: https://git.konstantinfickel.de/actions/forgejo-release@v2
|
||||
with:
|
||||
direction: upload
|
||||
url: https://git.konstantinfickel.de
|
||||
repo: kfickel/streamd
|
||||
token: ${{ secrets.RELEASE_TOKEN }}
|
||||
tag: ${{ steps.version.outputs.TAG }}
|
||||
release-dir: release
|
||||
verbose: true
|
||||
env:
|
||||
FORGEJO_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
TAG: ${{ steps.version.outputs.TAG }}
|
||||
run: |
|
||||
# Create the release
|
||||
release_response=$(curl -sS -X POST \
|
||||
-H "Authorization: token ${FORGEJO_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${TAG}\", \"body\": \"Release ${TAG}\"}" \
|
||||
"https://git.konstantinfickel.de/api/v1/repos/kfickel/streamd/releases")
|
||||
|
||||
release_id=$(echo "$release_response" | jq -r '.id')
|
||||
|
||||
if [ -z "$release_id" ] || [ "$release_id" = "null" ]; then
|
||||
echo "Failed to create release:"
|
||||
echo "$release_response"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Created release with ID: $release_id"
|
||||
|
||||
# Upload assets
|
||||
for file in release/*; do
|
||||
filename=$(basename "$file")
|
||||
echo "Uploading $filename..."
|
||||
curl -sS -X POST \
|
||||
-H "Authorization: token ${FORGEJO_TOKEN}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary "@$file" \
|
||||
"https://git.konstantinfickel.de/api/v1/repos/kfickel/streamd/releases/${release_id}/assets?name=${filename}"
|
||||
done
|
||||
|
||||
echo "Release ${TAG} created successfully"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue