Skip to content

[compat] MidnightControls 1.12.1+26.1 #120

[compat] MidnightControls 1.12.1+26.1

[compat] MidnightControls 1.12.1+26.1 #120

Workflow file for this run

# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.
name: Build and Release
on:
push:
branches:
- dev
- 'port/**'
- 'workflow/**'
tags:
- 'v3/**'
pull_request:
jobs:
build:
strategy:
matrix:
java: [ 25 ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Get Commit hash
run: |
if [ "${EVENT_NAME}" = "pull_request" ]; then
COMMIT_SHA=${PULL_SHA}
else
COMMIT_SHA=${GITHUB_SHA}
fi
echo "SHORT_SHA=$(echo $COMMIT_SHA | cut -c1-8)" >> $GITHUB_ENV
env:
EVENT_NAME: ${{ github.event_name }}
PULL_SHA: ${{ github.event.pull_request.head.sha }}
- name: Export Version
if: github.ref_type == 'tag'
run: echo "VERSION=${GITHUB_REF_NAME#*/}" >> $GITHUB_ENV
- name: Java ${{ matrix.java }} setup
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: gradle
- name: Make gradlew executable
if: runner.os == 'Linux'
run: chmod +x ./gradlew
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
- name: Gradle build
run: ./gradlew build -PverStr=${VERSION}
- name: Capture build artifacts
if: ${{ runner.os == 'Linux' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: "extrasounds-dev+${{env.SHORT_SHA}}"
path: build/libs/
- name: Create GitHub Release
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
with:
files: build/libs/*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}