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
|
cp result-musl/bin/streamd release/streamd-${{ steps.version.outputs.VERSION }}-linux-x86_64
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: https://git.konstantinfickel.de/actions/forgejo-release@v2
|
env:
|
||||||
with:
|
FORGEJO_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
direction: upload
|
TAG: ${{ steps.version.outputs.TAG }}
|
||||||
url: https://git.konstantinfickel.de
|
run: |
|
||||||
repo: kfickel/streamd
|
# Create the release
|
||||||
token: ${{ secrets.RELEASE_TOKEN }}
|
release_response=$(curl -sS -X POST \
|
||||||
tag: ${{ steps.version.outputs.TAG }}
|
-H "Authorization: token ${FORGEJO_TOKEN}" \
|
||||||
release-dir: release
|
-H "Content-Type: application/json" \
|
||||||
verbose: true
|
-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