Skip to content

Commit 5c53e8c

Browse files
committed
Move to GitHub Actions to build and deploy snapshots
Closes gh-924
1 parent 078f3d4 commit 5c53e8c

File tree

2 files changed

+49
-10
lines changed

2 files changed

+49
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build and Deploy Snapshot
2+
on:
3+
push:
4+
branches:
5+
- main
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
jobs:
9+
build:
10+
if: ${{ github.repository == 'spring-gradle-plugins/dependency-management-plugin' }}
11+
name: Build and Deploy Snapshot
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set up Java
15+
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
16+
with:
17+
distribution: 'liberica'
18+
java-version: 17
19+
- name: Check Out Code
20+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
21+
- name: Set Up Gradle
22+
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
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+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
34+
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
35+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
36+
run: ./gradlew -PdeploymentRepository=$(pwd)/distribution-repository build publishAllPublicationsToDeploymentRepository
37+
- name: Deploy
38+
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1
39+
with:
40+
uri: 'https://repo.spring.io'
41+
username: ${{ secrets.ARTIFACTORY_USERNAME }}
42+
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
43+
build-name: spring-restdocs
44+
repository: 'libs-snapshot-local'
45+
folder: 'deployment-repository'
46+
signing-key: ${{ secrets.GPG_PRIVATE_KEY }}
47+
signing-passphrase: ${{ secrets.GPG_PASSPHRASE }}
48+
artifact-properties: |
49+
/**/spring-restdocs-*.zip::zip.type=docs,zip.deployed=false

ci/pipeline.yml

-10
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,6 @@ jobs:
206206
<<: *slack-fail-params
207207
- put: repo-status-build
208208
params: { state: "success", commit: "git-repo" }
209-
- put: artifactory-repo
210-
params:
211-
<<: *artifactory-repo-put-params
212-
get_params:
213-
threads: 8
214-
on_failure:
215-
do:
216-
- put: slack-alert
217-
params:
218-
<<: *slack-fail-params
219209
- put: slack-alert
220210
params:
221211
<<: *slack-success-params

0 commit comments

Comments
 (0)