summaryrefslogtreecommitdiff
path: root/.github/workflows/forgewrapper-build.yml
blob: 5f9f70196549e60529e4b6cbbd60a15588624931 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: "ForgeWrapper: Build"

on:
  workflow_dispatch:
  workflow_call:

jobs:
  build:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: forgewrapper
    steps:
      - uses: actions/checkout@v6
      - name: Set up JDK
        uses: actions/setup-java@v4
        with:
          distribution: "temurin"
          java-version: "8"
          architecture: x64
      - name: Build with Gradle
        run: |
          chmod +x ./gradlew
          ./gradlew build -iS
      - uses: actions/upload-artifact@v7
        with:
          name: ForgeWrapper
          path: forgewrapper/build/libs

  publish:
    if: startsWith(github.ref, 'refs/tags/')
    needs: build
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: forgewrapper
    steps:
      - uses: actions/checkout@v6
      - name: Set up JDK
        uses: actions/setup-java@v4
        with:
          distribution: "temurin"
          java-version: "8"
          architecture: x64
      - name: Build with Gradle
        env:
          IS_PUBLICATION: true
        run: |
          chmod +x ./gradlew
          ./gradlew publish -iS
      - uses: actions/upload-artifact@v7
        with:
          name: ForgeWrapper-Release
          path: forgewrapper/build/libs