Change Text and Texture #46
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: CI For ExampleMod | |
on: | |
push: | |
paths: | |
- .github/workflows/** | |
- src/** | |
- gradle/scripts/** | |
- build.gradle | |
- gradle.properties | |
- settings.gradle | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_ACTION_NUMBER: ${{ vars.GITHUB_RUN_NUMBER }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: validate gradle wrapper | |
uses: gradle/actions/wrapper-validation@v3 | |
- name: Setup Java 17 | |
uses: actions/[email protected] | |
with: | |
distribution: zulu | |
java-version: 17 | |
- name: make gradle wrapper executable | |
if: ${{ runner.os != 'Windows' }} | |
run: chmod +x ./gradlew | |
- name: Build with Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Build | |
run: ./gradlew build | |
- name: Read Properties | |
id: 'properties' | |
uses: christian-draeger/[email protected] | |
with: | |
path: gradle.properties | |
properties: 'mod_id mod_name' | |
- name: Get Version | |
id: var | |
run: | | |
MESSAGE=$(ls build/libs/* | grep sources.jar -v | grep shadow.jar -v | grep slim.jar -v | awk -F '${{ steps.properties.outputs.mod_id }}-|.jar' '{print $2}') | |
echo version=$MESSAGE >> $GITHUB_OUTPUT | |
- name: Upload a Build Artifact | |
uses: actions/[email protected] | |
with: | |
name: "${{ steps.properties.outputs.mod_name }} ${{ steps.var.outputs.version }}" | |
path: build/libs/${{ steps.properties.outputs.mod_id }}-${{ steps.var.outputs.version }}.jar |