Compare commits

...

8 Commits

Author SHA1 Message Date
itqop 1f02781d07 change build.yml 2025-11-02 13:42:56 +03:00
itqop 01fd73fa1a change build.yml
Build and Release / build (push) Successful in 12m49s Details
2025-11-02 02:49:42 +03:00
itqop 73e3d4c5be change build.yml
Build and Release / build (push) Successful in 13m28s Details
2025-11-02 02:21:10 +03:00
itqop 4f8004cc98 change build.yml
Build and Release / build (push) Failing after 18s Details
2025-11-02 02:13:06 +03:00
itqop 8a6effbd13 change build.yml
Build and Release / build (push) Has been cancelled Details
2025-11-02 01:54:05 +03:00
itqop 48ef6c9552 change build.yml
Build and Release / build (push) Has been cancelled Details
2025-11-02 01:38:14 +03:00
itqop dac572eb23 change build.yml
Build and Release / build (push) Has been cancelled Details
2025-11-02 01:24:58 +03:00
itqop cc79ad5b60 change build.yml
Build and Release / build (push) Failing after 5s Details
2025-11-02 01:16:07 +03:00
1 changed files with 14 additions and 23 deletions

View File

@ -8,12 +8,18 @@ on:
jobs:
build:
runs-on: ubuntu-22.04
runs-on: node-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update
apt-get install -y default-jdk-headless jq curl
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
@ -41,42 +47,27 @@ 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
run: |
TAG_NAME="v${{ steps.version.outputs.mod_version }}"
RELEASE_NAME="Release $TAG_NAME"
TAG_NAME="${{ github.ref_name }}"
RESPONSE=$(curl -X POST \
RESPONSE=$(curl -s -X POST \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG_NAME\",\"name\":\"$RELEASE_NAME\",\"draft\":false,\"prerelease\":false}" \
-d "{\"tag_name\":\"$TAG_NAME\",\"name\":\"Release $TAG_NAME\",\"draft\":false,\"prerelease\":false}" \
"https://git.itqop.pw/api/v1/repos/itqop/whitelist-neoforge/releases")
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
echo "Release created with ID: $RELEASE_ID"
echo "Release ID: $RELEASE_ID"
- name: Upload JAR to Release
run: |
curl -X POST \
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 }}"
- name: Upload to Gitea Package Registry
run: |
VERSION="${{ steps.version.outputs.mod_version }}"
JAR_PATH="${{ steps.jar.outputs.jar_path }}"
JAR_NAME="${{ steps.jar.outputs.jar_name }}"
curl -X PUT \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-H "Content-Type: application/java-archive" \
--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 "✓ JAR uploaded to Release"