From 34e08b712d6a74a881b5249ab385392bfd53149d Mon Sep 17 00:00:00 2001 From: William Date: Thu, 5 Sep 2024 13:49:12 +0100 Subject: [PATCH] build: update CI to publish all active versions --- .github/workflows/ci.yml | 43 ++++++++++++++++++++----- .github/workflows/release.yml | 60 +++++++++++++++++++++++++++++++---- 2 files changed, 88 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10eafaf8..fd2203b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,20 +16,37 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: 'Checkout for CI 🛎️' - uses: actions/checkout@v4 - - name: 'Set up JDK 21 📦' + - name: 'Setup JDK 21 📦' uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' - - name: 'Build with Gradle 🏗️' - uses: gradle/gradle-build-action@v3 + - name: 'Setup Gradle 8.8 🏗️' + uses: gradle/actions/setup-gradle@v4 + with: + gradle-version: '8.8' + - name: '[Current - 1.21.1] 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: - arguments: build test publish + 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: | + cd 1.21.1 + ./gradlew clean build publish + cd .. + - name: '[LTS - 1.20.1] Build 🛎️' + run: | + cd 1.20.1 + ./gradlew clean build publish + cd .. - name: 'Publish Test Report 📊' uses: mikepenz/action-junit-report@v4 if: success() || failure() # Continue on failure @@ -37,11 +54,13 @@ jobs: report_paths: '**/build/test-results/test/TEST-*.xml' - name: 'Fetch Version Name 📝' run: | + cd 1.21.1 echo "::set-output name=VERSION_NAME::$(${{github.workspace}}/gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')" id: fetch-version - name: Get Version run: | echo "version_name=${{steps.fetch-version.outputs.VERSION_NAME}}" >> $GITHUB_ENV + cd .. - name: 'Publish to William278.net 🚀' uses: WiIIiam278/bones-publish-action@v1 with: @@ -53,12 +72,20 @@ 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 \ No newline at end of file + 1.21.1/target/HuskSync-Paper-${{ env.version_name }}+mc.1.21.1.jar + 1.21.1/target/HuskSync-Fabric-${{ env.version_name }}+mc.1.21.1.jar + 1.20.1/target/HuskSync-Paper-${{ env.version_name }}+mc.1.20.1.jar + 1.20.1/target/HuskSync-Fabric-${{ env.version_name }}+mc.1.20.1.jar \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f80aa7c..8a5d37a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,26 +8,72 @@ permissions: contents: read checks: write + jobs: build: runs-on: ubuntu-latest steps: - - name: 'Checkout for CI 🛎️' - uses: actions/checkout@v4 - - name: 'Set up JDK 21 📦' + - name: 'Setup JDK 21 📦' uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' - - name: 'Build with Gradle 🏗️' - uses: gradle/gradle-build-action@v3 + - name: 'Setup Gradle 8.8 🏗️' + uses: gradle/actions/setup-gradle@v4 + with: + gradle-version: '8.8' + - name: '[Current - 1.21.1] Checkout for CI 🛎️' + uses: actions/checkout@v4 with: - arguments: build test publish + 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: RELEASES_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} RELEASES_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + - name: '[Current - 1.21.1] Build 🛎️' + run: | + cd 1.21.1 + ./gradlew clean build publish + cd .. + - name: '[LTS - 1.20.1] Build 🛎️' + run: | + cd 1.20.1 + ./gradlew clean build publish + cd .. - 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' \ No newline at end of file + report_paths: '**/build/test-results/test/TEST-*.xml' + - name: 'Publish to William278.net 🚀' + uses: WiIIiam278/bones-publish-action@v1 + with: + api-key: ${{ secrets.BONES_API_KEY }} + project: 'husksync' + channel: 'release' + version: ${{ github.event.release.tag_name }} + changelog: ${{ github.event.release.body }} + 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: | + 1.21.1/target/HuskSync-Paper-${{ github.event.release.tag_name }}+mc.1.21.1.jar + 1.21.1/target/HuskSync-Fabric-${{ github.event.release.tag_name }}+mc.1.21.1.jar + 1.20.1/target/HuskSync-Paper-${{ github.event.release.tag_name }}+mc.1.20.1.jar + 1.20.1/target/HuskSync-Fabric-${{ github.event.release.tag_name }}+mc.1.20.1.jar \ No newline at end of file