diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..af672c31 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Publish + +on: + workflow_dispatch: + +jobs: + publish: + 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 }} + - 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 >> $GITHUB_ENV + echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV + - name: Build and Publish + run: | + jfrog rt gradle clean build artifactoryPublish + jfrog rt build-publish diff --git a/.gitignore b/.gitignore index e382978d..8e8a421b 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ classes .sts4-cache .attach_pid* nexus +.jfrog diff --git a/build.gradle b/build.gradle index 3f6a6c8d..491cb50b 100644 --- a/build.gradle +++ b/build.gradle @@ -421,7 +421,6 @@ project('spring-statemachine-uml') { project('spring-statemachine-build-tests') { description = 'Spring State Machine Build Tests' - tasks.findByPath('artifactoryPublish')?.enabled = false dependencies { testCompile project(':spring-statemachine-uml') @@ -535,7 +534,6 @@ project('spring-statemachine-starter') { configure(sampleProjects()) { apply plugin: 'org.springframework.boot' - tasks.findByPath('artifactoryPublish')?.enabled = false // as samples are not published, we can use jdk8 compileJava { sourceCompatibility = 1.8 @@ -563,7 +561,6 @@ configure(sampleProjects()) { } project('spring-statemachine-samples-common') { - tasks.findByPath('artifactoryPublish')?.enabled = false dependencies { compile project(':spring-statemachine-core') compile 'org.springframework.shell:spring-shell' @@ -575,6 +572,20 @@ project('spring-statemachine-samples-common') { configure(rootProject) { description = 'Spring State Machine' + pluginManager.withPlugin('com.jfrog.artifactory') { + artifactory { + publish { + defaults { + properties { + archives '*:*:*:*@zip', 'zip.deployed': false, 'zip.name': 'spring-statemachine', 'zip.displayname': 'Spring Statemachine' + archives '*:*:*:docs@zip', 'zip.type': 'docs' + archives '*:*:*:dist@zip', 'zip.type': 'dist' + } + } + } + } + } + dependencies { // just used to get version into docs compile 'org.springframework:spring-core'