Support remote build trigger #106
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: build-and-release | |
on: | |
- pull_request | |
- push | |
- workflow_dispatch | |
permissions: | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
build: | |
strategy: | |
matrix: | |
java: [ | |
21, | |
] | |
os: [ ubuntu-22.04 ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- name: validate gradle wrapper | |
uses: gradle/actions/wrapper-validation@v3 | |
- name: setup jdk ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'microsoft' | |
- name: make gradle wrapper executable | |
if: ${{ runner.os != 'Windows' }} | |
run: chmod +x ./gradlew | |
- name: download latest agronet jar | |
uses: robinraju/release-downloader@v1.10 | |
with: | |
repository: 'trackedout/agronet-fabric' | |
token: ${{ secrets.WORKER_PAT }} | |
latest: true | |
fileName: 'agronet-*' | |
out-file-path: 'agronet-fabric' | |
- name: download config files from brilliance | |
uses: robinraju/release-downloader@v1.10 | |
with: | |
repository: 'trackedout/Brilliance' | |
latest: true | |
fileName: '*.json' | |
out-file-path: 'brilliance-configs' | |
- name: build | |
env: | |
ORG_GRADLE_PROJECT_agronet_jar: agronet-fabric/agronet-1.0.0.jar | |
ORG_GRADLE_PROJECT_cards_json: brilliance-configs/Cards.json | |
ORG_GRADLE_PROJECT_artifacts_json: brilliance-configs/Artifacts.json | |
run: ./gradlew build | |
- name: capture build artifacts | |
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Artifacts | |
path: build/libs/ | |
- name: release | |
uses: softprops/action-gh-release@v2 | |
if: ${{ startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux' && matrix.java == '21' }} | |
with: | |
make_latest: true | |
files: | | |
build/libs/citadel-* | |
LICENSE |