Create LICENSE #50
Workflow file for this run
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: Run Gradle Build | |
on: [ push ] | |
jobs: | |
gradle: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Get Gradle version and check if it's pre release | |
run: | | |
VERSION=$(grep -Po '^version=.*' gradle.properties | cut -d= -f2) | |
VERSION=${VERSION#[[:space:]]} | |
SHOULD_RELEASE=$(grep -Po '^shouldRelease=.*' gradle.properties | cut -d= -f2) | |
SHOULD_RELEASE=${SHOULD_RELEASE#[[:space:]]} | |
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
echo "shouldRelease=$SHOULD_RELEASE" >> $GITHUB_OUTPUT | |
id: get_version | |
- name: Get short commit sha | |
id: short_sha | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- uses: actions/setup-java@v3 | |
name: Setup Java | |
with: | |
distribution: temurin | |
java-version: 17 | |
- uses: gradle/gradle-build-action@v2 | |
name: Setup Gradle | |
- name: Execute Gradle build | |
run: ./gradlew build | |
- uses: actions/upload-artifact@v3 | |
name: Upload built mod JAR | |
with: | |
name: mod-jar | |
path: build/libs/*.jar | |
- name: Create release with files | |
uses: softprops/action-gh-release@v1 | |
id: create_release | |
if: steps.get_version.outputs.shouldRelease == 'true' | |
with: | |
draft: false | |
name: SBHUD ${{ steps.get_version.outputs.VERSION }} | |
tag_name: ${{ steps.get_version.outputs.VERSION }}.${{ steps.short_sha.outputs.sha_short }} | |
files: | | |
build/libs/*.jar | |
body: | | |
Changelog: | |
${{ github.event.head_commit.message }} | |
token: ${{ secrets.ACCESS_TOKEN }} | |