Use Forgejo API directly for releases
All checks were successful
Build and Release / build (push) Successful in 1m27s
All checks were successful
Build and Release / build (push) Successful in 1m27s
The forgejo-release action has issues on NixOS runner.
💘 Generated with Crush
Assisted-by: Claude Opus 4.5 via Crush <crush@charm.land>
This commit is contained in:
parent
47a9442878
commit
86aa0f856c
1 changed files with 24 additions and 7 deletions
|
|
@ -12,7 +12,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
nix-env -iA nixpkgs.nodejs nixpkgs.openssh nixpkgs.curl nixpkgs.dotnetCorePackages.sdk_10_0-bin
|
nix-env -iA nixpkgs.nodejs nixpkgs.openssh nixpkgs.curl nixpkgs.jq nixpkgs.dotnetCorePackages.sdk_10_0-bin
|
||||||
dotnet --version
|
dotnet --version
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
@ -54,9 +54,26 @@ jobs:
|
||||||
chmod +x release/scry-embedded-linux-x64 release/scry-embedded-osx-x64
|
chmod +x release/scry-embedded-linux-x64 release/scry-embedded-osx-x64
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: https://code.forgejo.org/actions/forgejo-release@v2
|
env:
|
||||||
with:
|
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
direction: upload
|
run: |
|
||||||
release-dir: release
|
TAG="build-${{ github.run_number }}"
|
||||||
release-notes: "Automated release from CI"
|
REPO="${{ github.repository }}"
|
||||||
tag: ${{ github.run_number }}
|
API_URL="https://git.amarth.cloud/api/v1"
|
||||||
|
|
||||||
|
# Create release
|
||||||
|
RELEASE_ID=$(curl -fsSL -X POST \
|
||||||
|
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\": \"$TAG\", \"name\": \"$TAG\", \"body\": \"Automated release from CI\"}" \
|
||||||
|
"$API_URL/repos/$REPO/releases" | jq -r '.id')
|
||||||
|
|
||||||
|
# Upload assets
|
||||||
|
for file in release/*; do
|
||||||
|
filename=$(basename "$file")
|
||||||
|
curl -fsSL -X POST \
|
||||||
|
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
--data-binary "@$file" \
|
||||||
|
"$API_URL/repos/$REPO/releases/$RELEASE_ID/assets?name=$filename"
|
||||||
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue