|
| 1 | +name: Build and release Lambda |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + description: |
| 7 | + description: 'Description of the release' |
| 8 | + required: true |
| 9 | + default: 'Release' |
| 10 | + prerelease: |
| 11 | + description: 'Is this a prerelease?' |
| 12 | + required: true |
| 13 | + default: false |
| 14 | + |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + name: Build Lambda |
| 23 | + runs-on: ubuntu-latest |
| 24 | + permissions: |
| 25 | + contents: write |
| 26 | + env: |
| 27 | + SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5' |
| 28 | + steps: |
| 29 | + - name: Checkout Main |
| 30 | + uses: actions/checkout@v4.1.1 |
| 31 | + |
| 32 | + - name: Set up JDK |
| 33 | + uses: actions/setup-java@v4 |
| 34 | + with: |
| 35 | + distribution: 'oracle' |
| 36 | + java-version: '17' |
| 37 | + architecture: x64 |
| 38 | + cache: 'gradle' |
| 39 | + cache-dependency-path: | |
| 40 | + ~/.gradle/caches |
| 41 | + ~/.gradle/wrapper |
| 42 | +
|
| 43 | + - name: Read Gradle Properties |
| 44 | + uses: BrycensRanch/read-properties-action@v1.0.4 |
| 45 | + id: all |
| 46 | + with: |
| 47 | + file: gradle.properties |
| 48 | + all: true |
| 49 | + |
| 50 | + - name: Build Lambda |
| 51 | + run: ./gradlew --build-cache build |
| 52 | + |
| 53 | + - name: Upload Lambda Fabric |
| 54 | + uses: actions/upload-artifact@v4.3.6 |
| 55 | + with: |
| 56 | + name: lambda-fabric-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }} |
| 57 | + path: fabric/build/libs/ |
| 58 | + |
| 59 | + - name: Upload Lambda Forge |
| 60 | + uses: actions/upload-artifact@v4.3.6 |
| 61 | + with: |
| 62 | + name: lambda-forge-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }} |
| 63 | + path: forge/build/libs/ |
| 64 | + |
| 65 | + - name: Upload Lambda NeoForge |
| 66 | + uses: actions/upload-artifact@v4.3.6 |
| 67 | + with: |
| 68 | + name: lambda-neoforge-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }}.jar |
| 69 | + path: fabric/build/libs/ |
| 70 | + |
| 71 | + - name: Upload Lambda API |
| 72 | + uses: actions/upload-artifact@v4.3.6 |
| 73 | + with: |
| 74 | + name: lambda-${{ steps.all.outputs.modVersion }}.jar |
| 75 | + path: build/libs/ |
| 76 | + |
| 77 | + release: |
| 78 | + name: Release Lambda |
| 79 | + runs-on: ubuntu-latest |
| 80 | + needs: build |
| 81 | + permissions: |
| 82 | + contents: write |
| 83 | + steps: |
| 84 | + - name: Create release |
| 85 | + env: |
| 86 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 87 | + tag: ${{ steps.all.outputs.modVersion }} |
| 88 | + run: | |
| 89 | + gh release create "$tag" \ |
| 90 | + --repo="$GITHUB_REPOSITORY" \ |
| 91 | + --title="${GITHUB_REPOSITORY##*/} $tag" \ |
| 92 | + --notes="${{ github.event.inputs.description }}" \ |
| 93 | + if ${{ github.event.inputs.prerelease }}; then |
| 94 | + --prerelease |
| 95 | + fi |
| 96 | + |
0 commit comments