diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 0000000..8289093 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,27 @@ +name: Build +description: Builds the plugin +inputs: + develocity-access-key: + description: Access key for authentication with https://ge.spring.io + required: true +runs: + using: composite + steps: + - name: Set up Java + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + with: + distribution: 'liberica' + java-version: 8 + - name: Set Up Gradle + uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2 + - name: Configure Gradle Properties + shell: bash + run: | + mkdir -p $HOME/.gradle + echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties + echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties + echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties + - name: Build and Publish + env: + DEVELOCITY_ACCESS_KEY: ${{ inputs.develocity-access-key }} + run: ./gradlew -PdeploymentRepository=$(pwd)/artifactory build publishAllPublicationsToDeploymentRepository diff --git a/.github/actions/deploy-to-artifactory/action.yml b/.github/actions/deploy-to-artifactory/action.yml new file mode 100644 index 0000000..142e274 --- /dev/null +++ b/.github/actions/deploy-to-artifactory/action.yml @@ -0,0 +1,38 @@ +name: Deploy to Artifactory +description: Deploys artifacts to Artifactory +inputs: + build-name-version: + description: 'Version to append to the build name' + required: true + repository: + description: 'Artifactory repository to deploy to' + required: false + default: 'plugins-snapshot-local' + username: + description: 'Username for authentication with Artifactory' + required: true + password: + description: 'Password for authentication with Artifactory' + required: true + signing-key: + description: 'Key used to sign artifacts' + required: true + signing-passphrase: + description: 'Passphrase for the signing key' + required: true +runs: + using: composite + steps: + - name: Deploy + uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1 + with: + artifact-properties: | + /**/dependency-management-plugin-*.zip::zip.type=docs,zip.deployed=false + build-name: ${{ format('dependency-management-plugin-{0}', inputs.build-name-version }} + folder: 'artifactory' + username: ${{ inputs.username }} + password: ${{ inputs.password }} + repository: ${{ inputs.repository }} + signing-key: ${{ inputs.signing-key }} + signing-passphrase: ${{ inputs.signing-passphrase }} + uri: 'https://repo.spring.io' diff --git a/.github/workflows/build-and-deploy-snapshot.yml b/.github/workflows/build-and-deploy-snapshot.yml index e741354..7961158 100644 --- a/.github/workflows/build-and-deploy-snapshot.yml +++ b/.github/workflows/build-and-deploy-snapshot.yml @@ -11,37 +11,17 @@ jobs: name: Build and Deploy Snapshot runs-on: ubuntu-latest steps: - - name: Set up Java - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 - with: - distribution: 'liberica' - java-version: 8 - name: Check Out Code uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Set Up Gradle - uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2 - - name: Configure Gradle Properties - shell: bash - run: | - mkdir -p $HOME/.gradle - echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties - echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties - echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties - - name: Build and Publish - env: - GRADLE_ENTERPRISE_URL: 'https://ge.spring.io' - DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} - run: ./gradlew -PdeploymentRepository=$(pwd)/deployment-repository build publishAllPublicationsToDeploymentRepository + - name: Build + uses: ./.github/actions/build + with: + develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} - name: Deploy - uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1 + uses: ./.github/actions/deploy-to-artifactory with: - uri: 'https://repo.spring.io' + build-name-version: '1.1.x' username: ${{ secrets.ARTIFACTORY_USERNAME }} password: ${{ secrets.ARTIFACTORY_PASSWORD }} - build-name: dependency-management-plugin - repository: 'plugins-snapshot-local' - folder: 'deployment-repository' signing-key: ${{ secrets.GPG_PRIVATE_KEY }} signing-passphrase: ${{ secrets.GPG_PASSPHRASE }} - artifact-properties: | - /**/dependency-management-plugin-*.zip::zip.type=docs,zip.deployed=false