Skip to content

Commit

Permalink
Prepare snapshot workflow for addition of release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed May 2, 2024
1 parent 6cc618e commit 2ddde6f
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 26 deletions.
27 changes: 27 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -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
38 changes: 38 additions & 0 deletions .github/actions/deploy-to-artifactory/action.yml
Original file line number Diff line number Diff line change
@@ -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'
32 changes: 6 additions & 26 deletions .github/workflows/build-and-deploy-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2ddde6f

Please sign in to comment.