Skip to content

Commit 2ddde6f

Browse files
committed
Prepare snapshot workflow for addition of release workflow
1 parent 6cc618e commit 2ddde6f

File tree

3 files changed

+71
-26
lines changed

3 files changed

+71
-26
lines changed

.github/actions/build/action.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build
2+
description: Builds the plugin
3+
inputs:
4+
develocity-access-key:
5+
description: Access key for authentication with https://ge.spring.io
6+
required: true
7+
runs:
8+
using: composite
9+
steps:
10+
- name: Set up Java
11+
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
12+
with:
13+
distribution: 'liberica'
14+
java-version: 8
15+
- name: Set Up Gradle
16+
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
17+
- name: Configure Gradle Properties
18+
shell: bash
19+
run: |
20+
mkdir -p $HOME/.gradle
21+
echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties
22+
echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties
23+
echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties
24+
- name: Build and Publish
25+
env:
26+
DEVELOCITY_ACCESS_KEY: ${{ inputs.develocity-access-key }}
27+
run: ./gradlew -PdeploymentRepository=$(pwd)/artifactory build publishAllPublicationsToDeploymentRepository
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy to Artifactory
2+
description: Deploys artifacts to Artifactory
3+
inputs:
4+
build-name-version:
5+
description: 'Version to append to the build name'
6+
required: true
7+
repository:
8+
description: 'Artifactory repository to deploy to'
9+
required: false
10+
default: 'plugins-snapshot-local'
11+
username:
12+
description: 'Username for authentication with Artifactory'
13+
required: true
14+
password:
15+
description: 'Password for authentication with Artifactory'
16+
required: true
17+
signing-key:
18+
description: 'Key used to sign artifacts'
19+
required: true
20+
signing-passphrase:
21+
description: 'Passphrase for the signing key'
22+
required: true
23+
runs:
24+
using: composite
25+
steps:
26+
- name: Deploy
27+
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1
28+
with:
29+
artifact-properties: |
30+
/**/dependency-management-plugin-*.zip::zip.type=docs,zip.deployed=false
31+
build-name: ${{ format('dependency-management-plugin-{0}', inputs.build-name-version }}
32+
folder: 'artifactory'
33+
username: ${{ inputs.username }}
34+
password: ${{ inputs.password }}
35+
repository: ${{ inputs.repository }}
36+
signing-key: ${{ inputs.signing-key }}
37+
signing-passphrase: ${{ inputs.signing-passphrase }}
38+
uri: 'https://repo.spring.io'

.github/workflows/build-and-deploy-snapshot.yml

+6-26
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,17 @@ jobs:
1111
name: Build and Deploy Snapshot
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Set up Java
15-
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
16-
with:
17-
distribution: 'liberica'
18-
java-version: 8
1914
- name: Check Out Code
2015
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
21-
- name: Set Up Gradle
22-
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
23-
- name: Configure Gradle Properties
24-
shell: bash
25-
run: |
26-
mkdir -p $HOME/.gradle
27-
echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties
28-
echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties
29-
echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties
30-
- name: Build and Publish
31-
env:
32-
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
33-
DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
34-
run: ./gradlew -PdeploymentRepository=$(pwd)/deployment-repository build publishAllPublicationsToDeploymentRepository
16+
- name: Build
17+
uses: ./.github/actions/build
18+
with:
19+
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
3520
- name: Deploy
36-
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1
21+
uses: ./.github/actions/deploy-to-artifactory
3722
with:
38-
uri: 'https://repo.spring.io'
23+
build-name-version: '1.1.x'
3924
username: ${{ secrets.ARTIFACTORY_USERNAME }}
4025
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
41-
build-name: dependency-management-plugin
42-
repository: 'plugins-snapshot-local'
43-
folder: 'deployment-repository'
4426
signing-key: ${{ secrets.GPG_PRIVATE_KEY }}
4527
signing-passphrase: ${{ secrets.GPG_PASSPHRASE }}
46-
artifact-properties: |
47-
/**/dependency-management-plugin-*.zip::zip.type=docs,zip.deployed=false

0 commit comments

Comments
 (0)