87 lines
2.3 KiB
YAML
87 lines
2.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- 2.4.x
|
|
paths-ignore:
|
|
- '.github/**'
|
|
|
|
jobs:
|
|
|
|
# build and test, then upload logs if failure
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
java: [1.8]
|
|
fail-fast: false
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Setup JDK
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: ${{ matrix.java }}
|
|
- name: Build with Gradle
|
|
run: ./gradlew clean build
|
|
- name: Tar Build Logs
|
|
if: ${{ failure() }}
|
|
run: |
|
|
mkdir -p build
|
|
tar \
|
|
-zc \
|
|
--ignore-failed-read \
|
|
--file build/buildlogs.tar.gz \
|
|
*/build/reports \
|
|
*/*/build/reports
|
|
- name: Upload Build Logs
|
|
if: ${{ failure() }}
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: buildlogs
|
|
path: build/buildlogs.tar.gz
|
|
|
|
# if build job succeed, build without tests and publish
|
|
publish:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 1.8
|
|
- uses: jfrog/setup-jfrog-cli@v1
|
|
with:
|
|
version: 1.43.2
|
|
env:
|
|
JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
|
|
|
|
# setup non persistent config for jfrog gradle to use server defined in
|
|
# secret which points via virtual repo into spring local repo.
|
|
# modify default build name and number as we don't like how those
|
|
# gets used from action defaults.
|
|
- name: Configure JFrog Cli
|
|
run: |
|
|
jfrog rt gradlec \
|
|
--use-wrapper \
|
|
--deploy-ivy-desc=false \
|
|
--server-id-resolve=repo.spring.io \
|
|
--server-id-deploy=repo.spring.io \
|
|
--repo-resolve=snapshot \
|
|
--repo-deploy=snapshot
|
|
echo JFROG_CLI_BUILD_NAME=spring-statemachine-24x >> $GITHUB_ENV
|
|
echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV
|
|
|
|
# as we already tested just build and publish
|
|
- name: Build and Publish Snapshot
|
|
run: |
|
|
jfrog rt gradle clean build -x test artifactoryPublish
|
|
|
|
# publish build info so that we can see it in artifactory "builds"
|
|
- name: Publish Build Info
|
|
run: |
|
|
jfrog rt build-publish
|