Skip to content

Commit e21c083

Browse files
committed
Integrate shared workflows
1 parent 6a7dc15 commit e21c083

11 files changed

Lines changed: 184 additions & 84 deletions

.github/workflows/maven-build.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Mend CLI scan for Maven PR
2+
3+
on:
4+
workflow_run: # zizmor: ignore[dangerous-triggers]
5+
workflows: ["Java CI with Maven"]
6+
types: [completed]
7+
8+
permissions:
9+
contents: read
10+
actions: read
11+
checks: write
12+
pull-requests: write
13+
security-events: write
14+
15+
concurrency:
16+
group: mend-scan-${{ github.event.workflow_run.pull_requests[0].number || github.event.workflow_run.head_sha }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
scan:
21+
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
22+
uses: project-ncl/shared-github-actions/.github/workflows/mend-ci.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
23+
with:
24+
project_name: "Commonjava/commonjava"
25+
SCA: true
26+
SAST: false
27+
triggering_run_id: ${{ github.event.workflow_run.id }}
28+
pr_feedback: true
29+
secrets:
30+
MEND_URL: ${{ secrets.MEND_URL }}
31+
MEND_USER_KEY: ${{ secrets.MEND_USER_KEY }}
32+
MEND_EMAIL: ${{ secrets.MEND_EMAIL }}
33+
MEND_ORGNAME: ${{ secrets.MEND_ORGNAME }}
34+
MEND_PRODUCTNAME: ${{ secrets.MEND_PRODUCTNAME }}

.github/workflows/maven-mend.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Mend CLI scan for Maven
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
schedule:
8+
- cron: "0 22 * * 0"
9+
10+
permissions:
11+
contents: read
12+
actions: read
13+
checks: write
14+
pull-requests: write
15+
security-events: write
16+
17+
jobs:
18+
build:
19+
uses: project-ncl/shared-github-actions/.github/workflows/maven-ci.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
20+
with:
21+
java_version: "11"
22+
build_command: "MAVEN_OPTS='-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m' mvn -B -V clean verify -Prun-its -Pci"
23+
upload_artifacts: true
24+
25+
call-mend-ci:
26+
needs: build
27+
uses: project-ncl/shared-github-actions/.github/workflows/mend-ci.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
28+
with:
29+
project_name: "Commonjava/commonjava"
30+
SCA: true
31+
SAST: false
32+
secrets:
33+
MEND_URL: ${{ secrets.MEND_URL }}
34+
MEND_USER_KEY: ${{ secrets.MEND_USER_KEY }}
35+
MEND_EMAIL: ${{ secrets.MEND_EMAIL }}
36+
MEND_ORGNAME: ${{ secrets.MEND_ORGNAME }}
37+
MEND_PRODUCTNAME: ${{ secrets.MEND_PRODUCTNAME }}

.github/workflows/maven-pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Java CI with Maven
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches: ["*"]
9+
10+
jobs:
11+
call-maven-ci:
12+
uses: project-ncl/shared-github-actions/.github/workflows/maven-ci.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
13+
with:
14+
java_version: "11"
15+
build_command: "MAVEN_OPTS='-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m' mvn -B -V clean verify -Prun-its -Pci"
16+
upload_artifacts: true
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "0 Central Release Job" # Adding the 0 so that it's on top of the list of github actions
2+
on:
3+
workflow_dispatch: # Manual trigger so you don't release on every push
4+
inputs:
5+
ref_to_release:
6+
description: "[Optional] Branch or commit to release. Default: Github default branch"
7+
required: false
8+
type: string
9+
# default has to be a static string, no variables allowed
10+
default: ""
11+
12+
jobs:
13+
call-release-job:
14+
permissions:
15+
contents: write # needed to push commit and tag back to the repository
16+
uses: project-ncl/shared-github-actions/.github/workflows/maven-release.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
17+
with:
18+
java_version: "11"
19+
ref_to_release: ${{ inputs.ref_to_release }}
20+
release_command: 'mvn -B -V release:prepare release:perform -DlocalCheckout=true -DpushChanges=false'
21+
secrets:
22+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_BOT_USERNAME }}
23+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_BOT_TOKEN }}
24+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
25+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "0 Maven Set Version Job" # Adding the 0 so that it's on top of the list of github actions
2+
on:
3+
workflow_dispatch: # Manual trigger
4+
inputs:
5+
new_version:
6+
description: "[Required] Version to set"
7+
required: true
8+
type: string
9+
10+
ref_for_version:
11+
description: "[Optional] Branch or commit to change version. Default: Github default branch"
12+
required: false
13+
type: string
14+
# default has to be a static string, no variables allowed
15+
default: ""
16+
17+
jobs:
18+
call-maven-set-version-job:
19+
permissions:
20+
contents: write # needed to push commit and tag back to the repository
21+
uses: project-ncl/shared-github-actions/.github/workflows/maven-set-version.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
22+
with:
23+
java_version: "11"
24+
new_version: ${{ inputs.new_version }}
25+
ref_for_version: ${{ inputs.ref_for_version }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Build snapshot version and upload to Maven Central
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
7+
permissions: {}
8+
9+
jobs:
10+
call-snapshot-job:
11+
uses: project-ncl/shared-github-actions/.github/workflows/maven-snapshot.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
12+
with:
13+
java_version: "11"
14+
project_name: "Commonjava/commonjava"
15+
snapshot_deploy_command: "mvn help:effective-settings -B -V clean deploy -e"
16+
secrets:
17+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_BOT_USERNAME }}
18+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_BOT_TOKEN }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Validate GitHub Actions Workflows
2+
permissions: {}
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- ".github/workflows/*.yml"
8+
9+
jobs:
10+
validate:
11+
uses: project-ncl/shared-github-actions/.github/workflows/validate-gh-action.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23

codestyles/CommonJava.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<!--
22
3-
Copyright (C) 2011-2022 Red Hat, Inc. (http://github.com/Commonjava/commonjava)
3+
Copyright © 2011-2022 Red Hat, Inc. (http://github.com/Commonjava/commonjava)
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
77
You may obtain a copy of the License at
88
9-
http://www.apache.org/licenses/LICENSE-2.0
9+
http://www.apache.org/licenses/LICENSE-2.0
1010
1111
Unless required by applicable law or agreed to in writing, software
1212
distributed under the License is distributed on an "AS IS" BASIS,

pmd-ruleset.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0"?>
22
<!--
33
4-
Copyright (C) 2011-2022 Red Hat, Inc. (http://github.com/Commonjava/commonjava)
4+
Copyright © 2011-2022 Red Hat, Inc. (http://github.com/Commonjava/commonjava)
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
88
You may obtain a copy of the License at
99
10-
http://www.apache.org/licenses/LICENSE-2.0
10+
http://www.apache.org/licenses/LICENSE-2.0
1111
1212
Unless required by applicable law or agreed to in writing, software
1313
distributed under the License is distributed on an "AS IS" BASIS,

0 commit comments

Comments
 (0)