diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml deleted file mode 100644 index 178566c..0000000 --- a/.gitea/workflows/build.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Build Plugin -run-name: Build Plugin with maven -on: - push: - branches: - - '*' - tags: - - 'v*' - -jobs: - build-test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Tools - run: apt update -y && apt install -y maven - - name: Build - run: mvn clean package - - name: Upload - uses: actions/upload-artifact@v3 - with: - name: LSServerManager - path: target/LSServerManager*.jar - - name: Create Pre Release - run: | - FILES=./target/LSServerManager*.jar - USER=LagacySurvival - REPO=ServerManager - # Set up variables - AUTH_HEADER="Authorization: token ${{ secrets.TOKEN }}" - CONTENT_TYPE="Content-Type: application/json" - API_URL="https://dev.npid7.de/api/v1/repos/$USER/$REPO/releases" - COMMIT_HASH=$(git rev-parse --short HEAD) - AUTHOR_NAME=$(git log -1 --pretty=format:'%an') - COMMIT_SUBJECT=$(git log -1 --pretty=format:'%s') - COMMIT_MESSAGE=$(git log -1 --pretty=format:'%b') - DATETIME=$(date +'%Y%m%d_%H%M') - echo "Create Release" - RELEASE_INFO="{\"tag_name\": \"p$DATETIME\", \"name\": \"Test | $COMMIT_HASH\", \"body\": \"$AUTHOR_NAME - $COMMIT_SUBJECT\\n\\n$COMMIT_MESSAGE\", \"prerelease\": true}" - RESPONSE=$(curl -s -X POST -H "$AUTH_HEADER" -H "$CONTENT_TYPE" -d "$RELEASE_INFO" "$API_URL") - RELEASE_ID=$(echo $RESPONSE | jq --raw-output '.id') - echo "Release created with ID: $RELEASE_ID" - if [ "$RELEASE_ID" == "null" ]; then - echo "Failed to create release." - exit 1 - fi - echo "Upload File/s" - for file in $FILES; do - if [ -f "$file" ]; then - FILE_NAME=$(basename "$file") - FILE_PATH="$file" - FILE_SIZE=$(stat -c%s "$FILE_PATH") - UPLOAD_URL="https://dev.npid7.de/api/v1/repos/$USER/$REPO/releases/$RELEASE_ID/assets?name=$FILE_NAME" - CONTENT_LENGTH="Content-Length: $FILE_SIZE" - CONTENT_TYPE="Content-Type: application/7z-x-compressed" - echo "Uploading asset: $FILE_NAME" - RESPONSE=$(curl -s -X POST -H "Authorization: token ${{ secrets.TOKEN }}" \ - -H "$CONTENT_LENGTH" -H "$CONTENT_TYPE" \ - --upload-file "$FILE_PATH" "$UPLOAD_URL") - if echo "$RESPONSE" | jq -e '.message' >/dev/null; then - echo "Error uploading $FILE_NAME: $(echo "$RESPONSE" | jq -r .message)" - exit 1 - fi - echo "Successfully uploaded $FILE_NAME" - fi - done \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..85d09ba --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Server Manager \ No newline at end of file