diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2421fed0..8d70d7bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,19 +26,11 @@ jobs: java: - 1.8 - 9 + - 11 # LTS - 14 - 15 - - 11 # always last because used to build snapshots and releases steps: - - - name: info - run: | - echo ${{ matrix.java }} - echo ${{ github.event_name }} - echo ${{ github.ref }} - echo ${{ github.repository }} - - uses: actions/checkout@v2 - name: Setup Java ${{ matrix.java }} @@ -62,18 +54,68 @@ jobs: - name: Build with Gradle run: echo ./gradlew build + + snapshot: + runs-on: ubuntu-latest + needs: build + if: | + github.event_name == 'push' && + github.ref == 'refs/heads/github-actions' && + github.repository == 'JFormDesigner/FlatLaf' + + steps: + - uses: actions/checkout@v2 + + - name: Setup Java 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Cache Gradle wrapper + uses: actions/cache@v1 + with: + path: ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} + + - name: Cache Gradle cache + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }} + restore-keys: ${{ runner.os }}-gradle + - name: Publish snapshot to oss.jfrog.org run: echo ./gradlew artifactoryPublish - if: | - matrix.java == '11' && - github.event_name == 'push' && - github.ref == 'refs/heads/github-actions' && - github.repository == 'JFormDesigner/FlatLaf' + + + release: + runs-on: ubuntu-latest + needs: build + if: | + github.event_name == 'push' && + startsWith( github.ref, 'refs/tags/' ) && + github.repository == 'JFormDesigner/FlatLaf' + + steps: + - uses: actions/checkout@v2 + + - name: Setup Java 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Cache Gradle wrapper + uses: actions/cache@v1 + with: + path: ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} + + - name: Cache Gradle cache + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }} + restore-keys: ${{ runner.os }}-gradle - name: Release a new stable version to bintray run: echo ./gradlew bintrayUpload -Drelease=true - if: | - matrix.java == '11' && - github.event_name == 'push' && - startsWith( github.ref, 'refs/tags/' ) && - github.repository == 'JFormDesigner/FlatLaf'