From 642ff48a71c47522f7bb98ba3123531342732287 Mon Sep 17 00:00:00 2001 From: Gabriel Harris-Rouquette Date: Wed, 9 Oct 2024 18:47:21 -0700 Subject: [PATCH] chore(ci): enable publishing vanilla jars for update branches Signed-off-by: Gabriel Harris-Rouquette --- .github/workflows/deploy.yaml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 1ddb706d534..a6c0259019d 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -5,7 +5,9 @@ name: Build and Deploy on: push: - branches: [ 'api-*' ] + branches: + - 'api-*' + - 'update/*' tags-ignore: [ '**' ] env: @@ -22,13 +24,30 @@ jobs: publish: needs: integrationTest runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + project: + - vanilla + - forge + - neoforge + include: + - project: vanilla + gradleProject: SpongeVanilla + - project: forge + gradleProject: SpongeForge + - project: neoforge + gradleProject: SpongeNeo steps: - name: setup + if: !startsWith(github.ref, 'refs/heads/update/') || matrix.project == 'vanilla' id: setup uses: SpongePowered/.github/.github/actions/setup-java-env@master with: runtime_version: 21 + publishing_branch_regex: '' - name: setup / minecraft cache + if: !startsWith(github.ref, 'refs/heads/update/') || matrix.project == 'vanilla' uses: "actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9" # v4.0.2 with: path: | @@ -39,12 +58,14 @@ jobs: ${{ runner.os }}-minecraft-${{ env.CACHE_REV }}- # We don't need to run tests again, so we just publish - name: setup / workspace + if: !startsWith(github.ref, 'refs/heads/update/') || matrix.project == 'vanilla' run: | echo "GIT_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV - name: Publish to Sponge Maven & GitHub Packages - run: ./gradlew -s -Pprojects=vanilla,forge,neoforge :publish :SpongeVanilla:publish :SpongeForge:publish :SpongeNeo:publish + if: !startsWith(github.ref, 'refs/heads/update/') || matrix.project == 'vanilla' + run: ./gradlew -s -Pprojects=vanilla,${{ matrix.project }} :${{ matrix.gradleProject }}:publish env: CI_SYSTEM: Github Actions GITHUB_USERNAME: "${{ github.actor }}"