diff --git a/.github/workflows/ci_1.20.1.yml b/.github/workflows/ci_1.20.1.yml new file mode 100644 index 00000000..92a65d91 --- /dev/null +++ b/.github/workflows/ci_1.20.1.yml @@ -0,0 +1,70 @@ +name: CI Tests + +on: + push: + branches: [ 'minecraft/1.20.1' ] + paths-ignore: + - 'docs/**' + - 'workflows/**' + - 'README.md' + +permissions: + contents: read + checks: write + +jobs: + build: + name: 'Build - 1.20.1' + runs-on: ubuntu-latest + steps: + - name: 'Setup JDK 21 📦' + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + - name: 'Setup Gradle 8.8 🏗️' + uses: gradle/actions/setup-gradle@v4 + with: + gradle-version: '8.8' + - name: 'Checkout for CI 🛎️' + uses: actions/checkout@v4 + with: + ref: 'minecraft/1.20.1' + env: + SNAPSHOTS_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + SNAPSHOTS_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + - name: '[Current - 1.20.1] Build 🛎️' + run: | + ./gradlew clean build publish + - name: 'Publish Test Report 📊' + uses: mikepenz/action-junit-report@v4 + if: success() || failure() # Continue on failure + with: + report_paths: '**/build/test-results/test/TEST-*.xml' + - name: 'Fetch Version String 📝' + run: | + echo "::set-output name=VERSION_NAME::$(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')" + id: fetch-version + - name: 'Set Version Variable 📝' + run: | + echo "version_name=${{steps.fetch-version.outputs.VERSION_NAME}}" >> $GITHUB_ENV + - name: 'Publish to William278.net 🚀' + uses: WiIIiam278/bones-publish-action@v1 + with: + api-key: ${{ secrets.BONES_API_KEY }} + project: 'husksync' + channel: 'alpha' + version: ${{ env.version_name }} + changelog: ${{ github.event.head_commit.message }} + distro-names: | + paper-1.20.1 + fabric-1.20.1 + distro-groups: | + paper + fabric + distro-descriptions: | + Paper 1.20.1 + Fabric 1.20.1 + files: | + target/HuskSync-Paper-${{ env.version_name }}+mc.1.20.1.jar + target/HuskSync-Fabric-${{ env.version_name }}+mc.1.20.1.jar \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci_1.21.1.yml similarity index 70% rename from .github/workflows/ci.yml rename to .github/workflows/ci_1.21.1.yml index 9f44d60f..faa4d4fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci_1.21.1.yml @@ -14,6 +14,7 @@ permissions: jobs: build: + name: 'Build - 1.21.1' runs-on: ubuntu-latest steps: - name: 'Setup JDK 21 📦' @@ -25,31 +26,14 @@ jobs: uses: gradle/actions/setup-gradle@v4 with: gradle-version: '8.8' - - name: '[Current - 1.21.1] Checkout for CI 🛎️' + - name: 'Checkout for CI 🛎️' uses: actions/checkout@v4 - with: - path: '1_21_1' - - name: '[LTS - 1.20.1] Checkout for CI 🛎️' - uses: actions/checkout@v4 - with: - ref: 'minecraft/1.20.1' - path: '1_20_1' env: SNAPSHOTS_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} SNAPSHOTS_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - name: '[Current - 1.21.1] Build 🛎️' run: | - mkdir target - cd 1_21_1 ./gradlew clean build publish - cp -rf target/* ../target/ - cd .. - - name: '[LTS - 1.20.1] Build 🛎️' - run: | - cd 1_20_1 - ./gradlew clean build publish - cp -rf target/* ../target/ - cd .. - name: 'Publish Test Report 📊' uses: mikepenz/action-junit-report@v4 if: success() || failure() # Continue on failure @@ -57,13 +41,11 @@ jobs: report_paths: '**/build/test-results/test/TEST-*.xml' - name: 'Fetch Version String 📝' run: | - cd 1_21_1 echo "::set-output name=VERSION_NAME::$(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')" id: fetch-version - name: 'Set Version Variable 📝' run: | echo "version_name=${{steps.fetch-version.outputs.VERSION_NAME}}" >> $GITHUB_ENV - cd ${{ github.workspace }} - name: 'Publish to William278.net 🚀' uses: WiIIiam278/bones-publish-action@v1 with: @@ -75,20 +57,12 @@ jobs: distro-names: | paper-1.21.1 fabric-1.21.1 - paper-1.20.1 - fabric-1.20.1 distro-groups: | paper fabric - paper - fabric distro-descriptions: | Paper 1.21.1 Fabric 1.21.1 - Paper 1.20.1 - Fabric 1.20.1 files: | target/HuskSync-Paper-${{ env.version_name }}+mc.1.21.1.jar - target/HuskSync-Fabric-${{ env.version_name }}+mc.1.21.1.jar - target/HuskSync-Paper-${{ env.version_name }}+mc.1.20.1.jar - target/HuskSync-Fabric-${{ env.version_name }}+mc.1.20.1.jar \ No newline at end of file + target/HuskSync-Fabric-${{ env.version_name }}+mc.1.21.1.jar \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5404690..6f384df3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,7 @@ permissions: jobs: build: + name: 'Publish Release' runs-on: ubuntu-latest steps: - name: 'Setup JDK 21 📦' @@ -38,13 +39,13 @@ jobs: run: | mkdir target cd 1_21_1 - ./gradlew clean build publish + ./gradlew clean build publish -Dforce-hide-version-meta=1 cp -rf target/* ../target/ cd .. - name: '[LTS - 1.20.1] Build 🛎️' run: | cd 1_20_1 - ./gradlew clean build publish + ./gradlew clean build publish -Dforce-hide-version-meta=1 cp -rf target/* ../target/ cd .. - name: 'Publish Test Report 📊' diff --git a/.github/workflows/update_docs.yml b/.github/workflows/update_docs.yml index f0aeb54a..bf2dc352 100644 --- a/.github/workflows/update_docs.yml +++ b/.github/workflows/update_docs.yml @@ -13,7 +13,8 @@ permissions: contents: write jobs: - deploy-wiki: + update-docs: + name: 'Update Docs' runs-on: ubuntu-latest steps: - name: 'Checkout for CI 🛎️' diff --git a/build.gradle b/build.gradle index 9c2e2a4a..1866d2da 100644 --- a/build.gradle +++ b/build.gradle @@ -195,6 +195,11 @@ logger.lifecycle("Building HuskSync ${version} by William278 for Minecraft ${min @SuppressWarnings('GrMethodMayBeStatic') def versionMetadata() { + // If the force-hide-version-meta environment variable is set, return '' + if (System.getenv('force-hide-version-meta') != null) { + return '' + } + // Require grgit if (grgit == null) { return '-unknown'