Compare commits

..

No commits in common. "master" and "v0.1.01-BETA" have entirely different histories.

1 changed files with 23 additions and 14 deletions

View File

@ -8,18 +8,12 @@ on:
jobs:
build:
runs-on: node-latest
timeout-minutes: 15
runs-on: ubuntu-latest
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:
@ -47,27 +41,42 @@ 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 at $JAR_PATH"
echo "Found JAR: $JAR_NAME"
- name: Create Release
id: create_release
run: |
TAG_NAME="${{ github.ref_name }}"
TAG_NAME="v${{ steps.version.outputs.mod_version }}"
RELEASE_NAME="Release $TAG_NAME"
RESPONSE=$(curl -s -X POST \
RESPONSE=$(curl -X POST \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG_NAME\",\"name\":\"Release $TAG_NAME\",\"draft\":false,\"prerelease\":false}" \
-d "{\"tag_name\":\"$TAG_NAME\",\"name\":\"$RELEASE_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 ID: $RELEASE_ID"
echo "Release created with ID: $RELEASE_ID"
- name: Upload JAR to Release
run: |
curl -s -X POST \
curl -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 }}"
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"