Skip to content

Commit 4303d07

Browse files
committed
GitHub actions
1 parent 1e76408 commit 4303d07

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI Build
2+
3+
on:
4+
push:
5+
branches: [ main, 3.2.x, 3.1.x, gha ]
6+
7+
jobs:
8+
build:
9+
name: Build project
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v5
13+
- name: Set up Java
14+
uses: actions/setup-java@v5
15+
with:
16+
java-version: '25'
17+
distribution: temurin
18+
cache: maven
19+
- name: Cache Vault
20+
uses: actions/[email protected]
21+
with:
22+
path: |
23+
download
24+
vault
25+
key: ${{ runner.os }}-${{ hashFiles('src/test/bash/**') }}
26+
- name: Setup Vault
27+
run: src/test/bash/start.sh
28+
- name: Build
29+
run: ./mvnw -B -U clean verify
30+
deploy-snapshots:
31+
name: Deploy Snapshots
32+
runs-on: ubuntu-latest
33+
if: ${{ github.repository == 'spring-projects/spring-vault' }}
34+
steps:
35+
- uses: actions/checkout@v5
36+
- name: Set up Java
37+
uses: actions/setup-java@v5
38+
with:
39+
java-version: '25'
40+
distribution: temurin
41+
cache: maven
42+
- name: Cache Vault
43+
uses: actions/[email protected]
44+
with:
45+
path: |
46+
download
47+
vault
48+
key: ${{ runner.os }}-${{ hashFiles('src/test/bash/**') }}
49+
- name: Deploy to Artifactory
50+
env:
51+
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
52+
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
53+
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
54+
run: ci/snapshot.sh

ci/snapshot.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
MAVEN_OPTS=./mvnw -s settings.xml -Pci,snapshot,artifactory \
5+
-Dartifactory.server=https://repo.spring.io \
6+
-Dartifactory.username=${ARTIFACTORY_USR} \
7+
-Dartifactory.password=${ARTIFACTORY_PSW} \
8+
-Dartifactory.staging-repository=libs-snapshot-local \
9+
-Dartifactory.build-name=spring-vault \
10+
-Dartifactory.build-number=${BUILD_NUMBER} \
11+
-Dmaven.test.skip=true \
12+
clean deploy -U -B

0 commit comments

Comments
 (0)