change build.yml
Build and Release / build (push) Has been cancelled Details

This commit is contained in:
itqop 2025-11-02 01:54:05 +03:00
parent 48ef6c9552
commit 8a6effbd13
1 changed files with 6 additions and 3 deletions

View File

@ -9,6 +9,7 @@ on:
jobs:
build:
runs-on: node-latest
timeout-minutes: 15
steps:
- name: Checkout code
@ -46,7 +47,7 @@ jobs:
JAR_NAME=$(basename "$JAR_PATH")
echo "jar_path=$JAR_PATH" >> $GITHUB_OUTPUT
echo "jar_name=$JAR_NAME" >> $GITHUB_OUTPUT
echo "Found JAR: $JAR_NAME"
echo "Found JAR: $JAR_NAME at $JAR_PATH"
- name: Create Release
id: create_release
@ -60,6 +61,7 @@ jobs:
-d "{\"tag_name\":\"$TAG_NAME\",\"name\":\"$RELEASE_NAME\",\"draft\":false,\"prerelease\":false}" \
"https://git.itqop.pw/api/v1/repos/itqop/whitelist-neoforge/releases")
echo "API Response: $RESPONSE"
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
echo "Release created with ID: $RELEASE_ID"
@ -68,10 +70,11 @@ jobs:
run: |
curl -s -X POST \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-H "Content-Type: multipart/form-data" \
-F "attachment=@${{ steps.jar.outputs.jar_path }}" \
"https://git.itqop.pw/api/v1/repos/itqop/whitelist-neoforge/releases/${{ steps.create_release.outputs.release_id }}/assets?name=${{ steps.jar.outputs.jar_name }}"
echo "✓ JAR uploaded to Release"
- name: Upload to Gitea Package Registry
run: |
VERSION="${{ steps.version.outputs.mod_version }}"
@ -84,4 +87,4 @@ jobs:
--data-binary @"$JAR_PATH" \
"https://git.itqop.pw/api/packages/itqop/generic/whitelist-neoforge/$VERSION/$JAR_NAME"
echo "Package uploaded: https://git.itqop.pw/itqop/-/packages/generic/whitelist-neoforge/$VERSION"
echo "✓ Package uploaded to Registry"