# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Gradle Build/Test
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Cache
      uses: actions/cache@v2.1.3
      with:
        path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
        key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
        restore-keys: |
          ${{ runner.os }}-gradle-  
    - name: Grant execute permission for gradlew
      run: chmod +x gradlew
    - name: Set ENV
      run: echo "::set-env name=IS_RELEASE::${{startsWith(github.ref, 'refs/tags/v')}}"
    - name: Build with Gradle
      run: |
        echo $IS_RELEASE;
        ./gradlew assemble;
        ./gradlew installDist;
        ./gradlew shadowJar -Drelease=$IS_RELEASE;
        ./gradlew toolDoc -Drelease=$IS_RELEASE;      

# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Gradle Build/Test
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Cache
      uses: actions/cache@v2.1.3
      with:
        path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
        key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
        restore-keys: |
          ${{ runner.os }}-gradle-  
    - name: Grant execute permission for gradlew
      run: chmod +x gradlew
    - name: Build with Gradle
      run: |
        ./gradlew assemble;
        ./gradlew installDist;
        ./gradlew shadowJar -Drelease=:${{startsWith(github.ref, 'refs/tags/v')}};
        ./gradlew toolDoc -Drelease=:${{startsWith(github.ref, 'refs/tags/v')}};      

Switch from environment variables to context
Switch from environment variables to context