fix workflow #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Gradle CI (new) | |
on: | |
push: | |
paths-ignore: | |
- 'README.md' | |
- 'LICENSE' | |
- '.gitignore' | |
- '.editorconfig' | |
- 'changelog.md' | |
- 'mod-comparison.md' | |
pull_request: | |
jobs: | |
retrieve-targets: | |
runs-on: ubuntu-latest | |
name: Retrieve targets | |
outputs: | |
targets: ${{ steps.get-targets.outputs.targets }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get potential versions | |
id: get-targets | |
run: | | |
TARGETS=$(ls -d versions/*/ | xargs -n 1 basename | jq -Rc [inputs]) | |
echo "targets=$TARGETS" >> $GITHUB_OUTPUT | |
build: | |
needs: retrieve-targets | |
runs-on: ubuntu-latest | |
name: Build with gradle | |
# Folders in versions folder may not be registered in gradle, | |
# which will make this build fail. This is why we ignore errors. | |
continue-on-error: true | |
strategy: | |
matrix: | |
target: ${{ fromJson(needs.retrieve-targets.outputs.targets) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: temurin | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Switch sources to version ${{ matrix.target }} | |
run: ./gradlew "Refresh active project" buildAndCollectActive --stacktrace | |
env: | |
CI_SINGLE_BUILD: ${{ matrix.target }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: build/finalJars/*.jar | |
name: ${{ matrix.target }} |