update build actions and gradle to use new maven setup #2
This file contains hidden or 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: Dev Build | |
| on: | |
| push: | |
| branches: [ master, main, develop ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Get short commit hash | |
| id: vars | |
| run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
| - name: Set-Up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'oracle' | |
| java-version: '21' | |
| architecture: x64 | |
| cache: 'gradle' | |
| - name: Read Gradle Properties | |
| uses: BrycensRanch/read-properties-action@v1.0.4 | |
| id: all | |
| with: | |
| file: gradle.properties | |
| all: true | |
| - name: Publish dev build to Maven | |
| id: upload-maven | |
| run: | | |
| ./gradlew publish \ | |
| -PmavenType=dev \ | |
| -PbuildNumber=${{ github.run_number }} \ | |
| -PmavenUsername=${{ secrets.MAVEN_USER }} \ | |
| -PmavenPassword=${{ secrets.MAVEN_TOKEN }} | |
| - name: Rename jar | |
| run: mv build/libs/${{ steps.all.outputs.modId }}-${{ steps.all.outputs.modVersion }}.jar build/libs/${{ steps.all.outputs.modId }}-${{ steps.all.outputs.modVersion }}-dev.${{ github.run_number }}.jar | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lambda-loader-nightly | |
| path: build/libs/${{ steps.all.outputs.modId }}-${{ steps.all.outputs.modVersion }}-dev.${{ github.run_number }}.jar | |
| if-no-files-found: error |