Skip to content

Commit 802634c

Browse files
committed
Merge remote-tracking branch 'origin/master' into malwarescan-async-scan
* origin/master: (35 commits) feat(notification): Notify in case of Release failure (SAP#5045) fix(docs): remove dead links (SAP#5051) chore: remove obsolete cloud sdk conversion file (SAP#5036) feat: fail if script is not found in package.json file (SAP#5029) feat(sonar): Enable trustengine for token retrieval (SAP#5046) feat(trustengine): Add new resource reference to parameter docs generation (SAP#5038) docs: add unit test tags flag (SAP#4947) CONTRIBUTING.md (SAP#5042) addon.yml may now contain wildCard MAXX (SAP#5039) fix(codeqlExecuteScan): handle spaces in path to maven settings file (SAP#5037) feat(trustengine): Integrate Trust Engine into step config resolver (SAP#5032) fix(http): Use configured logger for retryClient (SAP#5040) Updated helm.sh/helm from 13.14.0 to 13.14.2 (SAP#5041) Copy full project (SAP#5033) feat(vault): support complex data types in secrets (SAP#5006) Added pagination logic for retrieving projects from Black Duck server (SAP#5031) Update aws deps (SAP#5034) Add possible values and default (SAP#5030) Fix security issues reported by Black Duck (SAP#5014) Exposing build artifact metadata from maven and npm (SAP#5008) ...
2 parents d60efd0 + 7eb4495 commit 802634c

File tree

103 files changed

+2070
-964
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+2070
-964
lines changed

.github/CONTRIBUTING.md

-217
This file was deleted.

.github/workflows/documentation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- uses: actions/setup-go@v5
2525
with:
26-
go-version: '1.21.x'
26+
go-version: '1.22.4'
2727

2828
- name: Install Groovy
2929
run: sudo apt-get update && sudo apt-get install groovy -y

.github/workflows/release-go.yml

+93-8
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
name: Create new Release
22

33
on:
4+
workflow_dispatch:
45
repository_dispatch:
56
types: perform-release
67
schedule:
78
- cron: '0 9 * * 1'
89

910
jobs:
1011
build:
12+
permissions: write-all
1113
name: Publish
1214
runs-on: ubuntu-latest
1315
steps:
1416
- uses: styfle/[email protected]
17+
1518
- uses: actions/checkout@v4
16-
# Workaround for https://github.com/SAP/jenkins-library/issues/1723, build only works with jdk8 currently
17-
- uses: actions/setup-java@v4
18-
with:
19-
java-version: 8
20-
distribution: zulu
21-
- name: Prepare Release
19+
20+
- name: Prepare assets and increment version
2221
run: |
2322
curl --insecure --silent --location --write-out '%{http_code}' --output ./piper_master https://github.com/SAP/jenkins-library/releases/latest/download/piper_master
2423
curl --insecure --silent --location --write-out '%{http_code}' --output ./piper_master-darwin.x86_64 https://github.com/SAP/jenkins-library/releases/latest/download/piper_master-darwin.x86_64
@@ -28,12 +27,59 @@ jobs:
2827
cp ./piper_master-darwin.arm64 ./piper-darwin.arm64
2928
npm install semver --quiet
3029
echo "PIPER_version=v$(node_modules/.bin/semver -i minor $(curl --silent "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest" | jq -r .tag_name))" >> $GITHUB_ENV
30+
3131
- uses: SAP/project-piper-action@master
32-
name: 'publish Linux master binary'
32+
name: Publish prerelease
3333
with:
3434
piper-version: master
3535
command: githubPublishRelease
36-
flags: --token ${{ secrets.GITHUB_TOKEN }} --assetPathList ./piper_master --assetPathList ./piper --assetPathList ./piper_master-darwin.x86_64 --assetPathList ./piper-darwin.x86_64 --assetPathList ./piper_master-darwin.arm64 --assetPathList ./piper-darwin.arm64
36+
flags: >
37+
--preRelease true
38+
--token ${{ secrets.GITHUB_TOKEN }}
39+
--assetPathList ./piper --assetPathList ./piper_master
40+
--assetPathList ./piper-darwin.x86_64 --assetPathList ./piper_master-darwin.x86_64
41+
--assetPathList ./piper-darwin.arm64 --assetPathList ./piper_master-darwin.arm64
42+
43+
- name: Download Piper binary from recently published prerelease
44+
uses: robinraju/release-downloader@v1
45+
with:
46+
tag: ${{ env.PIPER_version }}
47+
fileName: 'piper'
48+
49+
- name: Test binary (check output for 'commit:' substring)
50+
run: |
51+
chmod +x piper
52+
if ./piper version | grep -Fq "commit:"; then
53+
echo "piper binary test is successful"
54+
else
55+
echo "piper binary test failed"
56+
./piper version
57+
exit 1
58+
fi
59+
60+
- name: Get recently published prerelease id
61+
id: release_id
62+
run: >
63+
curl -L -s -o resp.json
64+
-H "Accept: application/vnd.github.raw+json"
65+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
66+
${{ github.api_url }}/repos/${{ github.repository }}/releases
67+
68+
echo "release_id=$(jq 'first(.[] | select(.tag_name == "${{ env.PIPER_version }}")).id' resp.json)" >> "$GITHUB_OUTPUT"
69+
70+
- name: Convert prereleae to Release
71+
run: >
72+
curl --fail-with-body -L -X PATCH
73+
-H "Accept: application/vnd.github+json"
74+
-H "Authorization: Bearer ${{ github.token }}"
75+
${{ github.api_url }}/repos/${{ github.repository }}/releases/${{ steps.release_id.outputs.release_id }}
76+
-d '{"prerelease": false, "make_latest": true}'
77+
78+
# Workaround for https://github.com/SAP/jenkins-library/issues/1723, build only works with jdk8 currently
79+
- uses: actions/setup-java@v4
80+
with:
81+
java-version: 8
82+
distribution: zulu
3783
- name: Build and publish jar for consumption in unit tests
3884
run: mvn package
3985
- uses: SAP/project-piper-action@master
@@ -42,3 +88,42 @@ jobs:
4288
piper-version: master
4389
command: githubPublishRelease
4490
flags: --token ${{ secrets.GITHUB_TOKEN }} --version latest --assetPath ./target/jenkins-library.jar
91+
92+
post:
93+
name: Post Action
94+
runs-on: ubuntu-latest
95+
needs: [build]
96+
if: always()
97+
steps:
98+
# Check status of the worklfow
99+
- uses: martialonline/workflow-status@v4
100+
id: check
101+
102+
# This step expects base64 encoded JSON object as below:
103+
# {
104+
# "smtp_url": "smtp+starttls://user:password@server:port",
105+
# "smtp_mail_from": "[email protected]",
106+
# "smtp_mail_rcpt": "[email protected]",
107+
# }
108+
- name: Decode SMTP secrets and set them in GITHUB_ENV
109+
id: smtp_secrets
110+
if: steps.check.outputs.status == 'failure' || steps.check.outputs.status == 'cancelled'
111+
run: >
112+
echo "${{ secrets.SMTP_CONFIG }}" |
113+
base64 --decode |
114+
jq -r 'to_entries[] | "\(.key)=\(.value)"' |
115+
while read line; do
116+
echo "$line" >> $GITHUB_ENV; echo "::add-mask::${line#*=}";
117+
done
118+
- name: Notify Piper team on failure or cancelled
119+
if: steps.smtp_secrets.conclusion == 'success'
120+
uses: dawidd6/action-send-mail@v3
121+
with:
122+
connection_url: ${{ env.smtp_url }}
123+
subject: Workflow failure in ${{ github.repository }}
124+
priority: high
125+
to: ${{ env.smtp_mail_rcpt }}
126+
from: Piper on GitHub <${{ env.smtp_mail_from }}>
127+
body: |
128+
Workflow '${{ github.workflow }}' has a job with status '${{ steps.check.outputs.status }}'.
129+
Workflow link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

.github/workflows/update-go-dependencies.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: actions/setup-go@v5
1515
with:
16-
go-version: '1.21.x'
16+
go-version: '1.22.4'
1717
- name: Perform update
1818
run: |
1919
git checkout -B gh-action-update-golang-dependencies

.github/workflows/upload-go-master.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: actions/setup-go@v5
1515
with:
16-
go-version: '1.21.x'
16+
go-version: '1.22.4'
1717
- env:
1818
CGO_ENABLED: 0
1919
run: |

0 commit comments

Comments
 (0)