Skip to content
Closed

test #37

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
maven-version: ${{ env.MAVEN_VERSION }}
project-name: com.sap.cds.feature.notifications
included-modules: cds-feature-notifications
scan_mode: FULL
scan_mode: RAPID
#rapid_compare_mode: BOM_COMPARE # PRs might only be blocked by things they introduce, not by pre-existing issues that could have appeared in the main branch in the meantime
124 changes: 124 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Deploy to Maven Central

env:
JAVA_VERSION: '17'
MAVEN_VERSION: '3.9.15'

on:
release:
types: [ "released" ]

jobs:
requires-approval:
runs-on: ubuntu-latest
name: "Waiting for release approval"
environment: release-approval
permissions:
contents: read
steps:
- name: Approval Step
run: echo "Release has been approved!"

verify-version:
needs: requires-approval
name: Verify Version Matches Tag
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ github.event.release.tag_name }}

- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: sapmachine
cache: maven

- name: Set up Maven
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
with:
maven-version: ${{ env.MAVEN_VERSION }}

- name: Verify pom.xml revision matches release tag
run: |
TAG="${{ github.event.release.tag_name }}"
REVISION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout)
echo "Tag: $TAG"
echo "Revision: $REVISION"
if [ "$TAG" != "$REVISION" ]; then
echo "::error::Release tag '$TAG' does not match pom.xml <revision> '$REVISION'. Open a 'Prep release' PR to bump the version before tagging."
exit 1
fi
shell: bash

blackduck:
needs: verify-version
name: Blackduck Scan
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ github.event.release.tag_name }}

- name: Scan With Black Duck
uses: cap-java/.github/actions/scan-with-blackduck@296573b55e906f5c77a1855bcfe4285cbbc5cac4 #main
with:
blackduck_token: ${{ secrets.BLACK_DUCK_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
maven-version: ${{ env.MAVEN_VERSION }}
project-name: com.sap.cds.feature.notifications
included-modules: cds-feature-notifications
version: ${{ github.event.release.tag_name }}

build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 30
needs: verify-version
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ github.event.release.tag_name }}

- name: Build
uses: cap-java/.github/actions/build@296573b55e906f5c77a1855bcfe4285cbbc5cac4 #main
with:
java-version: ${{ env.JAVA_VERSION }}
maven-version: ${{ env.MAVEN_VERSION }}

deploy:
name: Deploy to Maven Central
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [blackduck, build]
environment: release
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ github.event.release.tag_name }}

- name: Deploy
uses: cap-java/.github/actions/deploy-release@296573b55e906f5c77a1855bcfe4285cbbc5cac4 #main
with:
user: ${{ secrets.CENTRAL_REPOSITORY_USER }}
password: ${{ secrets.CENTRAL_REPOSITORY_PASS }}
gpg-pub-key: ${{ secrets.PGP_PUBKEY_ID }}
gpg-private-key: ${{ secrets.PGP_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.PGP_PASSPHRASE }}
revision: ${{ github.event.release.tag_name }}
maven-version: ${{ env.MAVEN_VERSION }}
53 changes: 51 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

<!-- Versions of CAP Java and cds-dk used for build and integrations tests -->
<!-- https://central.sonatype.com/artifact/com.sap.cds/cds-services-api/versions -->
<cds.services.version>4.9.0</cds.services.version>
<cds.services.version>4.9.1</cds.services.version>
<!-- https://www.npmjs.com/package/@sap/cds-dk?activeTab=versions -->
<cds.cdsdk-version>8.9.11</cds.cdsdk-version>

Expand All @@ -88,7 +88,7 @@
<dependency>
<groupId>com.sap.cloud.sdk</groupId>
<artifactId>sdk-bom</artifactId>
<version>5.24.0</version>
<version>5.31.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -121,6 +121,55 @@
<artifactId>cds-feature-notifications</artifactId>
<version>${revision}</version>
</dependency>

<!-- Security overrides: force versions not yet shipped by cds-services-bom -->
<!-- These can possibly be removed when upgrading to cds.services 5.0.0 -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.22.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.22</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.22.0</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.84</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>1.84</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.9.25</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-common</artifactId>
<version>1.9.25</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk7</artifactId>
<version>1.9.25</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>1.9.25</version>
</dependency>
<!-- Security overrides end -->
</dependencies>
</dependencyManagement>

Expand Down
Loading