Skip to content

Build github artifact instead of uploading to maven #4

Build github artifact instead of uploading to maven

Build github artifact instead of uploading to maven #4

Workflow file for this run

name: Nightly Build
on:
push:
branches:
- '*.*'
jobs:
build:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
name: Build Lambda
runs-on: ubuntu-latest
permissions:
contents: write
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
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: Build
run: ./gradlew build
- name: Rename jar
run: mv build/libs/lambda-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }}.jar build/libs/lambda-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }}-${{ env.COMMIT_HASH }}.jar
- name: Upload Artifact
uses: actions/upload-artifact@v4
id: upload
with:
name: lambda-nightly
path: |
build/libs/lambda-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }}-${{ env.COMMIT_HASH }}.jar
- name: Generate Summary
if: steps.upload.conclusion == 'success'
run: |
COMMIT_MESSAGE=$(git log --pretty=format:'- \`%h\` %s' -1 --reverse)
echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV
cat << EOF >> $GITHUB_STEP_SUMMARY
### Lambda ${{ steps.all.outputs.modVersion }} ${{ steps.all.outputs.minecraftVersion }} (${{ env.COMMIT_HASH }})
Artifact: lambda-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }}-${{ env.COMMIT_HASH }}.jar
EOF