Only publish a version per branch/tag #78
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 Build | |
on: [ push, pull_request ] | |
jobs: | |
build: | |
name: Build lin-bus on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Build with Gradle | |
run: ./gradlew build -s | |
- name: "Kill Daemons Because Apparently GitHub Won't Do It For You" | |
run: ./gradlew --stop | |
- uses: actions/upload-artifact@v4 | |
name: Archive Reports | |
if: always() | |
with: | |
name: reports for ${{ matrix.os }} | |
path: '**/build/reports/**' | |
build-all-distributions: | |
if: ${{ github.event_name == 'push' }} | |
name: Build lin-bus NBT Editor distribtions on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
needs: [ build ] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest, macos-12 ] # macos-12 for x86 support | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Publish distributions | |
env: | |
B2_APPLICATION_KEY_ID: ${{ secrets.B2_KEY_ID }} | |
B2_APPLICATION_KEY: ${{ secrets.B2_APPLICATION_KEY }} | |
B2_BUCKET_NAME: octy-enginehub | |
B2_PREFIX: ${{ github.ref_type == 'tag' && 'lin-bus-distributions/@APP_VERSION@' || format('lin-bus-distributions/{0}', github.ref_name) }} | |
run: ./gradlew :gui:uploadDistributions -s | |
- name: "Kill Daemons Because Apparently GitHub Won't Do It For You" | |
run: ./gradlew --stop | |