Skip to content

Commit

Permalink
chore(ci): enable publishing vanilla jars for update branches
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
  • Loading branch information
gabizou committed Oct 10, 2024
1 parent 1ec66a9 commit 642ff48
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ name: Build and Deploy

on:
push:
branches: [ 'api-*' ]
branches:
- 'api-*'
- 'update/*'
tags-ignore: [ '**' ]

env:
Expand All @@ -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: |
Expand All @@ -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 }}"
Expand Down

0 comments on commit 642ff48

Please sign in to comment.