mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
GitHub Actions: use separate jobs for snapshots and releases to be sure that build succeeded for all Java versions
This commit is contained in:
80
.github/workflows/ci.yml
vendored
80
.github/workflows/ci.yml
vendored
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user