Skip to content

Commit

Permalink
Extract artifactory-init.gradle
Browse files Browse the repository at this point in the history
* Modify GHA workflows to copy `artifactory-init.gradle` as Gradle init script
* Use fully-qualified names for reusable workflows making workflow callers as generic
  • Loading branch information
artembilan committed Nov 6, 2023
1 parent 9dae670 commit 5b55578
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 32 deletions.
17 changes: 17 additions & 0 deletions .github/artifactory-init.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
artifactory {
publish {
defaults {
def zipArtifactProps =
['zip.name': 'spring-integration-aws',
'zip.displayname': 'Spring Integration Aws',
'zip.deployed': 'false']
properties {
mavenJava zipArtifactProps, '*:*:*:*@zip'
mavenJava 'zip.type': 'docs', '*:*:*:docs@zip'
mavenJava 'zip.type': 'dist', '*:*:*:dist@zip'
}

publications('mavenJava')
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/ci-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ on:

jobs:
build_snapshot:
uses: ./.github/workflows/spring-artifactory-gradle-snapshot.yml
uses: spring-projects/spring-integration-aws/.github/workflows/spring-artifactory-gradle-snapshot.yml@main
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ on:

jobs:
build:
uses: ./.github/workflows/spring-gradle-pull-request-build.yml
uses: spring-projects/spring-integration-aws/.github/workflows/spring-gradle-pull-request-build.yml@main
2 changes: 1 addition & 1 deletion .github/workflows/promote-ga-to-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
release_to_central:
uses: ./.github/workflows/spring-artifactory-promote-central.yml
uses: spring-projects/spring-integration-aws/.github/workflows/spring-artifactory-promote-central.yml@main
with:
buildName: ${{ inputs.buildName }}
buildNumber: ${{ inputs.buildNumber }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/promote-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
promote_milestone:
uses: ./.github/workflows/spring-artifactory-promote-milestone.yml
uses: spring-projects/spring-integration-aws/.github/workflows/spring-artifactory-promote-milestone.yml@main
with:
buildName: ${{ inputs.buildName }}
buildNumber: ${{ inputs.buildNumber }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ run-name: Release version ${{ inputs.releaseVersion }}

jobs:
staging:
uses: ./.github/workflows/spring-artifactory-gradle-release-staging.yml
uses: spring-projects/spring-integration-aws/.github/workflows/spring-artifactory-gradle-release-staging.yml@main
with:
releaseVersion: ${{ inputs.releaseVersion }}
secrets: inherit
14 changes: 11 additions & 3 deletions .github/workflows/spring-artifactory-gradle-release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Gradle
uses: spring-io/spring-gradle-build-action@v2

- name: Checkout Common Repo
uses: actions/checkout@v3
with:
repository: spring-projects/spring-integration-aws

- name: Copy the artifactory-init.gradle
run: cp .github/artifactory-init.gradle $GRADLE_USER_HOME/init.d

- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}

- name: Set up Gradle
uses: spring-io/spring-gradle-build-action@v2

- uses: jfrog/setup-jfrog-cli@v3
with:
version: 2.50.4
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/spring-artifactory-gradle-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@ jobs:
name: CI Build SNAPSHOT for ${{ github.ref_name }}
steps:

- uses: actions/checkout@v3

- name: Set up Gradle
uses: spring-io/spring-gradle-build-action@v2

- name: Checkout Common Repo
uses: actions/checkout@v3
with:
repository: spring-projects/spring-integration-aws

- name: Copy the artifactory-init.gradle
run: cp .github/artifactory-init.gradle $GRADLE_USER_HOME/init.d

- uses: actions/checkout@v3

- uses: jfrog/setup-jfrog-cli@v3
with:
version: 2.50.4
Expand Down
22 changes: 0 additions & 22 deletions publish-maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,4 @@ publishing {
}
}
}
}

if (isCI) {
artifactory {
publish {
defaults {
def zipArtifactProps =
['zip.name': 'spring-integration-aws',
'zip.displayname': 'Spring Integration Aws',
'zip.deployed': 'false']
properties {
mavenJava zipArtifactProps, '*:*:*:*@zip'
mavenJava 'zip.type': 'docs', '*:*:*:docs@zip'
mavenJava 'zip.type': 'dist', '*:*:*:dist@zip'
}
}
}
}

tasks.named('artifactoryPublish') {
publications(publishing.publications.mavenJava)
}
}

0 comments on commit 5b55578

Please sign in to comment.