Skip to content

Commit 91188d5

Browse files
changes
1 parent 5fbfb00 commit 91188d5

30 files changed

Lines changed: 3872 additions & 0 deletions

.github/actions/build/action.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Maven Build
2+
description: "Builds a Maven project."
3+
4+
inputs:
5+
java-version:
6+
description: "The Java version the build shall run with."
7+
required: true
8+
maven-version:
9+
description: "The Maven version the build shall run with."
10+
required: true
11+
mutation-testing:
12+
description: "Whether to run mutation testing."
13+
default: 'true'
14+
required: false
15+
16+
runs:
17+
using: composite
18+
steps:
19+
- name: Set up Java ${{ inputs.java-version }}
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: ${{ inputs.java-version }}
23+
distribution: sapmachine
24+
cache: maven
25+
26+
- name: Set up Maven ${{ inputs.maven-version }}
27+
uses: stCarolas/setup-maven@v5
28+
with:
29+
maven-version: ${{ inputs.maven-version }}
30+
31+
- name: Build with Maven
32+
run: |
33+
mvn clean install -P unit-tests -DskipIntegrationTests
34+
shell: bash
35+
36+
# - name: Piper Maven build
37+
# uses: SAP/project-piper-action@main
38+
# with:
39+
# step-name: mavenBuild
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Maven Release
2+
description: "Deploys a Maven package to Maven Central repository."
3+
4+
inputs:
5+
user:
6+
description: "The user used for the upload (technical user for maven central upload)"
7+
required: true
8+
password:
9+
description: "The password used for the upload (technical user for maven central upload)"
10+
required: true
11+
profile:
12+
description: "The profile id"
13+
required: true
14+
pgp-pub-key:
15+
description: "The public pgp key ID"
16+
required: true
17+
pgp-private-key:
18+
description: "The private pgp key"
19+
required: true
20+
pgp-passphrase:
21+
description: "The passphrase for pgp"
22+
required: true
23+
revision:
24+
description: "The revision of sdm"
25+
required: true
26+
27+
runs:
28+
using: composite
29+
steps:
30+
- name: "Echo Inputs"
31+
run: |
32+
echo "user: ${{ inputs.user }}"
33+
echo "profile: ${{ inputs.profile }}"
34+
shell: bash
35+
36+
- name: "Setup Java"
37+
uses: actions/setup-java@v4
38+
with:
39+
distribution: 'sapmachine'
40+
java-version: '17'
41+
cache: maven
42+
server-id: central
43+
server-username: MAVEN_CENTRAL_USER
44+
server-password: MAVEN_CENTRAL_PASSWORD
45+
46+
- name: "Import GPG Key"
47+
run: |
48+
echo "${{ inputs.pgp-private-key }}" | gpg --batch --passphrase "$PASSPHRASE" --import
49+
shell: bash
50+
env:
51+
PASSPHRASE: ${{ inputs.pgp-passphrase }}
52+
53+
- name: "Ensure Local Repo Directory"
54+
run: |
55+
mkdir -p ./deploy-oss/temp_local_repo
56+
ls -al ./deploy-oss
57+
shell: bash
58+
59+
- name: Deploy to Maven Central
60+
run: >
61+
mvn -B -ntp --show-version
62+
-Dmaven.install.skip=true
63+
-Dmaven.test.skip=true
64+
-Dgpg.passphrase="$GPG_PASSPHRASE"
65+
-Dgpg.keyname="$GPG_PUB_KEY"
66+
clean deploy -P deploy-release
67+
shell: bash
68+
env:
69+
MAVEN_CENTRAL_USER: ${{ inputs.user }}
70+
MAVEN_CENTRAL_PASSWORD: ${{ inputs.password }}
71+
GPG_PASSPHRASE: ${{ inputs.pgp-passphrase }}
72+
GPG_PUB_KEY: ${{ inputs.pgp-pub-key }}
73+
74+
# - name: "Deploy Locally"
75+
# run: |
76+
# echo "Deploying artifacts locally..."
77+
# mvn --batch-mode --no-transfer-progress --fail-at-end --show-version \
78+
# -Durl=file:./temp_local_repo \
79+
# -Dmaven.install.skip=true \
80+
# -Dmaven.test.skip=true \
81+
# -Dgpg.passphrase="$GPG_PASSPHRASE" \
82+
# -Dgpg.keyname="$GPG_PUB_KEY" \
83+
# -Drevision="${{ inputs.revision }}" \
84+
# deploy
85+
# working-directory: ./deploy-oss
86+
# shell: bash
87+
# env:
88+
# MAVEN_CENTRAL_USER: ${{ inputs.user }}
89+
# MAVEN_CENTRAL_PASSWORD: ${{ inputs.password }}
90+
# GPG_PASSPHRASE: ${{ inputs.pgp-passphrase }}
91+
# GPG_PUB_KEY: ${{ inputs.pgp-pub-key }}
92+
93+
# - name: "List Contents of Local Repo"
94+
# run: |
95+
# echo "Contents of temp_local_repo:"
96+
# ls -al ./deploy-oss/temp_local_repo
97+
# shell: bash
98+
99+
# - name: "Deploy Staging"
100+
# run: |
101+
# mvn --batch-mode --no-transfer-progress --fail-at-end --show-version \
102+
# org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:deploy-staged-repository \
103+
# -DserverId=ossrh \
104+
# -DnexusUrl=https://oss.sonatype.org \
105+
# -DrepositoryDirectory=./temp_local_repo \
106+
# -DstagingProfileId="$MAVEN_CENTRAL_PROFILE_ID" \
107+
# -Drevision="${{ inputs.revision }}"
108+
# working-directory: ./deploy-oss
109+
# shell: bash
110+
# env:
111+
# MAVEN_CENTRAL_USER: ${{ inputs.user }}
112+
# MAVEN_CENTRAL_PASSWORD: ${{ inputs.password }}
113+
# MAVEN_CENTRAL_PROFILE_ID: ${{ inputs.profile }}

.github/actions/deploy/action.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Deploy to artifactory
2+
description: "Deploys artifacts to artifactory."
3+
4+
inputs:
5+
repository-url:
6+
description: "The URL of the repository to upload to."
7+
required: true
8+
server-id:
9+
description: "The service id of the repository to upload to."
10+
required: true
11+
user:
12+
description: "The user used for the upload."
13+
required: true
14+
password:
15+
description: "The password used for the upload."
16+
required: true
17+
pom-file:
18+
description: "The path to the POM file."
19+
required: false
20+
default: "pom.xml"
21+
maven-version:
22+
description: "The Maven version the build shall run with."
23+
required: true
24+
25+
runs:
26+
using: composite
27+
steps:
28+
- name: Echo Inputs
29+
run: |
30+
echo "repository-url: ${{ inputs.repository-url }}"
31+
echo "user: ${{ inputs.user }}"
32+
echo "password: ${{ inputs.password }}"
33+
echo "pom-file: ${{ inputs.pom-file }}"
34+
echo "altDeploymentRepository: ${{inputs.server-id}}::default::${{inputs.repository-url}}"
35+
shell: bash
36+
37+
- name: Setup Java 17
38+
uses: actions/setup-java@v4
39+
with:
40+
distribution: sapmachine
41+
java-version: '17'
42+
server-id: ${{ inputs.server-id }}
43+
server-username: CAP_DEPLOYMENT_USER
44+
server-password: CAP_DEPLOYMENT_PASS
45+
46+
- name: Setup Maven ${{ inputs.maven-version }}
47+
uses: stCarolas/setup-maven@v5
48+
with:
49+
maven-version: ${{ inputs.maven-version }}
50+
51+
- name: Deploy
52+
run: >
53+
mvn -B -ntp --fae --show-version
54+
-DaltDeploymentRepository=${{inputs.server-id}}::default::${{inputs.repository-url}}
55+
-Dmaven.install.skip=true
56+
-Dmaven.test.skip=true
57+
-f ${{ inputs.pom-file }}
58+
deploy
59+
env:
60+
CAP_DEPLOYMENT_USER: ${{ inputs.user }}
61+
CAP_DEPLOYMENT_PASS: ${{ inputs.password }}
62+
shell: bash
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Update POM with new release
2+
description: Updates the revision property in the POM file with the new release version.
3+
4+
inputs:
5+
java-version:
6+
description: "The Java version the build shall run with."
7+
required: true
8+
maven-version:
9+
description: "The Maven version the build shall run with."
10+
default: '3.6.3'
11+
required: false
12+
13+
runs:
14+
using: composite
15+
steps:
16+
- name: Set up JDK ${{ inputs.java-version }}
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: ${{ inputs.java-version }}
20+
distribution: sapmachine
21+
cache: maven
22+
23+
- name: Set up Maven ${{ inputs.maven-version }}
24+
uses: stCarolas/setup-maven@v5
25+
with:
26+
maven-version: ${{ inputs.maven-version }}
27+
28+
- name: Update version
29+
run: |
30+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
31+
echo $VERSION > cap-notebook/version.txt
32+
mvn --no-transfer-progress versions:set-property -Dproperty=revision -DnewVersion=$VERSION
33+
#chmod +x ensure-license.sh
34+
#./ensure-license.sh
35+
git config --global user.name 'github-actions[bot]'
36+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
37+
git checkout -b develop
38+
git add cap-notebook/version.txt
39+
git commit -am "Update version to $VERSION"
40+
git push --set-upstream origin develop
41+
shell: bash

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "maven"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
open-pull-requests-limit: 10
8+
allow:
9+
- dependency-name: "com.sap.cds:cds-services-bom"
10+
- dependency-name: "com.sap.cloud.sdk:sdk-bom"
11+
12+
- package-ecosystem: "maven"
13+
directory: "/sdm"
14+
schedule:
15+
interval: "daily"
16+
open-pull-requests-limit: 10
17+
allow:
18+
- dependency-name: "com.sap.cds:cds-feature-attachments"
19+
- dependency-name: "com.sap.cloud.security.xsuaa:token-client"
20+
21+
- package-ecosystem: "github-actions"
22+
directory: "/"
23+
schedule:
24+
interval: "daily"
25+
open-pull-requests-limit: 10

0 commit comments

Comments
 (0)