aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
blob: 88ec02ff476b24468d42cfef21623a9f9c815ac0 (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: Build

on:
  push:
    branches:
      - '**'
  pull_request:

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    env:
      PROPERTIES_PATH: gradle.properties

      steps:
        - uses: actions/checkout@v2

        - name: Set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

        - name: Grant execute permission for gradlew
        run: chmod +x gradlew

        - name: Setup ForgeGradle
        run: ./gradlew setupCIWorkspace

        - name: Read mod name
        id: read_mod_name
        uses: christian-draeger/read-properties@1.0.1
        with:
          path: ${{ env.PROPERTIES_PATH }}
          property: archivesBaseName

        - name: Read mod version
        id: read_mod_version
        uses: christian-draeger/read-properties@1.0.1
        with:
          path: ${{ env.PROPERTIES_PATH }}
          property: version

        - name: Build with Gradle
        run: ./gradlew build

        - name: Upload mod jar
        env:
          mod_jar_name: ${{ steps.read_mod_name.outputs.value }}-${{ steps.read_mod_version.outputs.value }}
          mod_jar_path: build/libs/${{ steps.read_mod_name.outputs.value }}-${{ steps.read_mod_version.outputs.value }}.jar
        uses: actions/upload-artifact@v1.0.0
        with:
          name: ${{ env.mod_jar_name }}
          path: ${{ env.mod_jar_path }}