diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 402b117..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,2 +0,0 @@ -* @BX-Team/bx-team-maintainers -/.github/CODEOWNERS @BX-Team/bx-team-maintainers diff --git a/.github/workflows/build-1214.yml b/.github/workflows/build-1214.yml new file mode 100644 index 0000000..c480070 --- /dev/null +++ b/.github/workflows/build-1214.yml @@ -0,0 +1,82 @@ +name: Build DivineMC 1.21.4 + +on: + push: + branches: + - "master" + workflow_dispatch: + +jobs: + build: + runs-on: blacksmith-8vcpu-ubuntu-2204 + if: "!contains(github.event.commits[0].message, '[ci-skip]')" + env: + BUILD_NUMBER: ${{ github.run_number }} + outputs: + build_number: ${{ env.BUILD_NUMBER }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Gradle Cache + uses: useblacksmith/cache@v5 + with: + path: | + ~/.gradle/caches/modules-2 + ~/.gradle/caches/jars-* + ~/.gradle/caches/transforms-* + ~/.gradle/wrapper + ~/.gradle/build-cache-* + ~/.gradle/configuration-cache-* + .gradle/patchCache + .gradle/patched + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'patches/**/*.patch') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Gradle Cache Cleanup + run: | + mkdir -p ~/.gradle/caches/modules-2 + [ -f ~/.gradle/caches/modules-2/modules-2.lock ] && rm -f ~/.gradle/caches/modules-2/modules-2.lock + find ~/.gradle/caches -name "*.lock" -type f -delete || echo "No lock files found" + + - name: Setup JDK 21 + uses: useblacksmith/setup-java@v5 + with: + distribution: temurin + java-version: 21 + + - name: Configure Git and Gradle + run: | + git config --global user.email "no-reply@github.com" + git config --global user.name "Github Actions" + git config --global core.preloadindex true + git config --global core.fscache true + git config --global gc.auto 256 + chmod +x gradlew + + - name: Apply Patches + run: | + PARALLELISM=$(($(nproc) * 2)) + ./gradlew applyAllPatches --stacktrace --parallel --max-workers=$PARALLELISM --build-cache --no-daemon + + - name: Build Paperclip Jar + run: ./gradlew createMojmapPaperclipJar --stacktrace --parallel --no-daemon + + - name: Prepare Release Info + run: bash scripts/releaseInfo.sh + env: + BUILD_NUMBER: ${{ env.BUILD_NUMBER }} + + - name: Create Release + uses: ncipollo/release-action@v1.15.0 + with: + artifacts: ${{ env.jar }} + bodyFile: ${{ env.info }} + tag: ${{ env.tag }} + name: ${{ env.name }} + prerelease: ${{ env.experimental }} + token: ${{ secrets.GITHUB_TOKEN }} + makeLatest: ${{ env.make_latest }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 81c67ec..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: DivineMC CI - -on: - push: - branches: - - "master" - workflow_dispatch: - -jobs: - build: - runs-on: blacksmith-8vcpu-ubuntu-2204 - if: "!contains(github.event.commits[0].message, '[ci-skip]')" - steps: - - name: Setup Action - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - with: - add-job-summary: never - generate-job-summary: false - cache-read-only: false - - - name: Setup JDK 21 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 21 - - - name: Configure Git and Gradle - run: | - git config --global user.email "no-reply@github.com" && git config --global user.name "Github Actions" - echo "BUILD_NUMBER=$GITHUB_RUN_NUMBER" >> $GITHUB_ENV - chmod +x gradlew - - - name: Patch - run: ./gradlew applyAllPatches --stacktrace - - - name: Build Paperclip Jar - run: ./gradlew createMojmapPaperclipJar --stacktrace - - - name: Publish API - continue-on-error: true - run: ./gradlew publish -PdivinemcUsername=${{ secrets.REPO_USERNAME }} -PdivinemcPassword=${{ secrets.REPO_SECRET }} - - - name: Get Release Info - run: bash scripts/releaseInfo.sh - env: - BUILD_NUMBER: ${{ env.BUILD_NUMBER }} - - - name: Create Release - uses: ncipollo/release-action@v1.15.0 - with: - artifacts: ${{ env.jar }} - bodyFile: ${{ env.info }} - tag: ${{ env.tag }} - name: ${{ env.name }} - prerelease: ${{ env.experimental }} - token: ${{ secrets.GITHUB_TOKEN }} - makeLatest: ${{ env.make_latest }} diff --git a/.github/workflows/publish-api.yml b/.github/workflows/publish-api.yml new file mode 100644 index 0000000..8078e3f --- /dev/null +++ b/.github/workflows/publish-api.yml @@ -0,0 +1,44 @@ +name: Publish API + +on: + push: + branches: [ "master" ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@main + with: + fetch-depth: 0 + + - name: Setup JDK 21 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + cache: gradle + + - name: Configure Git and Gradle + run: | + git config --global user.email "no-reply@github.com" && git config --global user.name "Github Actions" + chmod +x gradlew + + - name: Apply patches + run: | + PARALLELISM=$(($(nproc) * 2)) + ./gradlew applyAllPatches --stacktrace --parallel --max-workers=$PARALLELISM --build-cache --no-daemon + + - name: Build + run: ./gradlew build -x test + + - name: Publish API + continue-on-error: true + run: | + ./gradlew :divinemc-api:publish + ./gradlew publishDevBundlePublicationToDivinemcRepository -PpublishDevBundle=true + env: + REPO_USERNAME: ${{ secrets.REPO_USERNAME }} + REPO_PASSWORD: ${{ secrets.REPO_SECRET }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index f6ecade..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: DivineMC Test CI - -on: - push: - branches-ignore: [ master ] - pull_request: - workflow_dispatch: - -jobs: - build: - runs-on: blacksmith-8vcpu-ubuntu-2204 - if: "!contains(github.event.commits[0].message, '[ci-skip]')" - steps: - - name: Setup Action - uses: actions/checkout@v4 - - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - - - name: Setup JDK 21 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 21 - cache: 'gradle' - - - name: Configure Git and Gradle - run: | - git config --global user.email "no-reply@github.com" && git config --global user.name "Github Actions" - chmod +x gradlew - - - name: Patch - run: ./gradlew applyAllPatches --stacktrace - - - name: Build Paperclip Jar - run: ./gradlew createMojmapPaperclipJar --stacktrace - - - name: Upload Artifacts - uses: actions/upload-artifact@main - with: - name: DivineMC - path: divinemc-server/build/libs/divinemc-paperclip-*-mojmap.jar