Skip to content

Commit

Permalink
ci: Split common build into separate job
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Oct 23, 2024
1 parent 89f89ea commit ecfd43f
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,35 @@ jobs:
with:
script: |
return {
loader: [${{inputs.fabric}} ? 'fabric' : false, ${{inputs.forge}} ? 'forge' : false, ${{inputs.neoforge}} ? 'neoforge' : false].filter(Boolean),
loader: ['common', '${{inputs.fabric}} ? 'fabric' : false, ${{inputs.forge}} ? 'forge' : false, ${{inputs.neoforge}} ? 'neoforge' : false].filter(Boolean),
site: ['curseforge', 'modrinth', 'publish'],
exclude: [
{loader: 'common', site: 'curseforge'},
{loader: 'common', site: 'modrinth'}
]
}
build-common:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
- name: Make gradle wrapper executable
run: chmod +x ./gradlew
- name: Build common artifact
run: ./gradlew :common:build '-Pversion=${{needs.create-release.outputs.version}}'
- name: Upload common artifact
uses: actions/upload-artifact@v4
with:
name: common-artifact
path: common/build
needs: create-release
build-release:
runs-on: ubuntu-latest
strategy:
Expand All @@ -89,14 +111,21 @@ jobs:
distribution: temurin
- name: Make gradle wrapper executable
run: chmod +x ./gradlew
- name: Download common artifact
uses: actions/download-artifact@v4
with:
name: common-artifact
path: common/build
- name: Build ${{ matrix.loader }} artifact
run: ./gradlew :${{ matrix.loader }}:build '-Pversion=${{needs.create-release.outputs.version}}'
- name: Upload ${{ matrix.loader }} artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.loader }}-artifact
path: ${{ matrix.loader }}/build
needs: create-release
needs:
- create-release
- build-common
publish-release:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -133,4 +162,5 @@ jobs:
run: sha1sum ${{ matrix.loader }}/build/libs/*
needs:
- create-release
- build-common
- build-release

0 comments on commit ecfd43f

Please sign in to comment.