Skip to content

Commit

Permalink
Merge branch 'feature-1139-rename-parts-with-emailAdress-to-emailAddr…
Browse files Browse the repository at this point in the history
…ess' of https://github.com/zigfridus/sechub into feature-1139-rename-parts-with-emailAdress-to-emailAddress
  • Loading branch information
zigfridus committed Nov 22, 2023
2 parents ae61228 + d0ffddf commit 092b015
Show file tree
Hide file tree
Showing 22 changed files with 407 additions and 135 deletions.
113 changes: 111 additions & 2 deletions .github/workflows/documentation-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,121 @@ name: Documentation build

on:
workflow_dispatch:
inputs:
publish-documentation:
description: Insert your email address here if you want to create a PR for Github pages update (branch `master`)
required: false
schedule:
# Nightly build documentation:
# cron runs on the default branch: `develop` in our case.
- cron: '32 23 * * *'

env:
ACTIONS_SECHUB_DOC_RELEASE_BRANCH: master

jobs:
build-documentation:
name: build documentation
runs-on: ubuntu-latest
steps:
- name: "Hello world"
- name: "Show + check Input and git branch"
run: |
echo "git branch: '${{ github.ref_name }}'"
echo "publish-documentation: '${{ inputs.publish-documentation }}'"
if [ '${{ inputs.publish-documentation }}' != '' -a '${{ github.ref_name }}' != "$ACTIONS_SECHUB_DOC_RELEASE_BRANCH" ] ; then
echo "Aborting run because publishing the documentation must be done on branch '$ACTIONS_SECHUB_DOC_RELEASE_BRANCH'"
echo "Tip: Run this action again and select branch '$ACTIONS_SECHUB_DOC_RELEASE_BRANCH'"
exit 1
fi
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin

- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.4

- uses: actions/cache@v3.3.2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install graphviz (asciidoc diagrams)
run: sudo apt-get --assume-yes install graphviz

# -----------------------------------------
# Build documentation
# -----------------------------------------
- name: Complete build with documentation
run: ./buildDoc

# -----------------------------------------
# Upload documentation
# -----------------------------------------
- name: Archive documentation HTML
uses: actions/upload-artifact@v3
with:
name: sechub-docs-html
path: sechub-doc/build/docs/final-html/
retention-days: 14

- name: Archive documentation PDF
uses: actions/upload-artifact@v3
with:
name: sechub-docs-pdf
path: sechub-doc/build/docs/asciidoc/*.pdf
retention-days: 14

# -----------------------------------------
# Update and commit documentation for https://mercedes-benz.github.io/sechub/
# -----------------------------------------
- name: Update documentation - publish and commit
if: (inputs.publish-documentation != '') && (github.ref_name == env.ACTIONS_SECHUB_DOC_RELEASE_BRANCH)
run: |
git config user.name "$GITHUB_TRIGGERING_ACTOR (via github-actions)"
git config user.email "${{ inputs.publish-documentation }}"
git reset --hard
sechub-doc/helperscripts/publish+git-add-releasedocs.sh
git commit -m "docs update by '$GITHUB_TRIGGERING_ACTOR' (via github-actions)"
# -----------------------------------------
# Create pull request for documentation update
# -----------------------------------------
- name: Update documentation - Create pull request
if: (inputs.publish-documentation != '') && (github.ref_name == env.ACTIONS_SECHUB_DOC_RELEASE_BRANCH)
id: pr_release_documentation
uses: peter-evans/create-pull-request@v5.0.2
with:
branch: release-documentation
branch-suffix: short-commit-hash
delete-branch: true
title: '1 - Release documentation [auto-generated]'
body: |
Release of SecHub documentation
-> Please review before merge.
- name: Update documentation - Print PR infos
if: (inputs.publish-documentation != '') && (github.ref_name == env.ACTIONS_SECHUB_DOC_RELEASE_BRANCH)
run: |
echo "Hello world"
echo "Pull Request Number - ${{ steps.pr_release_documentation.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.pr_release_documentation.outputs.pull-request-url }}"
34 changes: 6 additions & 28 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ jobs:
with:
java-version: 17
distribution: temurin
cache: gradle

- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false

- name: Set up Go
uses: actions/setup-go@v4
Expand Down Expand Up @@ -112,33 +116,7 @@ jobs:
path: sechub-cli/build/go
retention-days: 14

- name: Install graphviz (asciidoc diagrams)
run: sudo apt-get -qq --assume-yes install graphviz

# -----------------------------------------
# Build Documentation
# -----------------------------------------
- name: Create documentation
run: ./gradlew documentation -Dsechub.build.stage=all

# -----------------------------------------
# Upload documentation
# -----------------------------------------
- name: Archive documentation HTML
uses: actions/upload-artifact@v3
with:
name: sechub-docs-html
path: sechub-doc/build/docs/final-html/
retention-days: 14

- name: Archive documentation PDF
uses: actions/upload-artifact@v3
with:
name: sechub-docs-pdf
path: sechub-doc/build/docs/asciidoc/*.pdf
retention-days: 14

- name: Archive documentation openAPI3
- name: Archive openAPI3 JSON files
uses: actions/upload-artifact@v3
with:
name: sechub-api-spec
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/publish-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ jobs:
with:
java-version: 17
distribution: temurin
cache: gradle

- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false

- name: Build
run: ./gradlew clean build -x :sechub-integrationtest:test -x :sechub-cli:build
Expand Down Expand Up @@ -63,24 +67,24 @@ jobs:
name: git-status.txt
path: build/reports/git-status.txt
retention-days: 14

# -----------------------------------------
# Assert releaseable, so no dirty flags on releases
# even when all artifact creation parts are done!
# -----------------------------------------
- name: Assert releasable
run: ./gradlew assertReleaseable

# **************************************************
# Now let's create + publish a new LIBRARIES release
# **************************************************

# Publish to github packages
# Publish to github packages
- name: Publish
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token

# Create release
- name: Create libraries release
id: create_libraries_release
Expand All @@ -97,4 +101,4 @@ jobs:
For details about changes look at [Milestone ${{github.event.inputs.milestone-number}}]( https://github.com/mercedes-benz/sechub/milestone/${{github.event.inputs.milestone-number}}?closed=1)
draft: false
prerelease: false

20 changes: 12 additions & 8 deletions .github/workflows/release-client-server-pds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Release
on:
workflow_dispatch:
inputs:
actor-email:
description: Insert your email address here. It will be used in the generated pull requests
server-version:
description: Server Version (e.g. 0.27.0)
required: false
Expand Down Expand Up @@ -42,6 +44,7 @@ jobs:
steps:
- name: "Show Inputs"
run: |
echo "actor-email: '${{ inputs.actor-email }}'"
echo "Server '${{ inputs.server-version }}' - Milestone '${{ inputs.server-milestone-number }}'"
echo "Client '${{ inputs.client-version }}' - Milestone '${{ inputs.client-milestone-number }}'"
echo "PDS '${{ inputs.pds-version }}' - Milestone '${{ inputs.pds-milestone-number }}'"
Expand Down Expand Up @@ -89,7 +92,11 @@ jobs:
with:
java-version: 17
distribution: temurin
cache: gradle

- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false

- name: Set up Go
uses: actions/setup-go@v4
Expand Down Expand Up @@ -123,8 +130,8 @@ jobs:
- name: run apply-headers.sh
id: apply-headers
run: |
git config user.name "SecHub release job (github-actions)"
git config user.email github-actions-sechub@users.noreply.github.com
git config user.name "$GITHUB_TRIGGERING_ACTOR (via github-actions)"
git config user.email "${{ inputs.actor-email }}"
./apply-headers.sh
git commit -am "SPDX headers added by SecHub release job @github-actions" || true
COMMITS=`git log --oneline --branches --not --remotes`
Expand Down Expand Up @@ -239,7 +246,7 @@ jobs:
retention-days: 14

- name: Install graphviz (asciidoc diagrams)
run: sudo apt-get -qq --assume-yes install graphviz
run: sudo apt-get --assume-yes install graphviz

# -----------------------------------------
# Build Documentation
Expand All @@ -264,7 +271,7 @@ jobs:
path: sechub-doc/build/docs/asciidoc/*.pdf
retention-days: 14

- name: Archive documentation openAPI3
- name: Archive openAPI3 JSON files
uses: actions/upload-artifact@v3
with:
name: sechub-api-spec
Expand Down Expand Up @@ -293,9 +300,6 @@ jobs:
title: '1 - Release documentation [auto-generated]'
body: |
Release of SecHub documentation
- Server "${{ inputs.server-version }}"
- Client "${{ inputs.client-version }}"
- PDS "${{ inputs.pds-version }}"
-> Please review and merge **before** publishing the release.
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/release-pds-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Release PDS-Tools
on:
workflow_dispatch:
inputs:
actor-email:
description: Insert your email address here. It will be used in the generated pull requests
pds-tools-version:
description: PDS-Tools Version (e.g. 0.1.0)
required: true
Expand All @@ -18,9 +20,10 @@ jobs:

- name: "Show Inputs"
run: |
echo "actor-email: '${{ inputs.actor-email }}'"
echo "PDS-Tools '${{ inputs.pds-tools-version }}' - Milestone '${{ inputs.pds-tools-milestone-number }}'"
# Check inputs if a milestone number is provided for each version to be released:
# Check inputs if a milestone number is provided for each version to be released:
- name: "Verify Input: PDS-Tools"
if: (inputs.pds-tools-version != '') && (inputs.pds-tools-milestone-number == '')
run: |
Expand All @@ -47,16 +50,20 @@ jobs:
with:
java-version: 17
distribution: temurin
cache: gradle

- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false

# ----------------------
# Create pull request if license headers are missing
# ----------------------
- name: run apply-headers.sh
id: apply-headers
run: |
git config user.name "SecHub release job (github-actions)"
git config user.email github-actions-sechub@users.noreply.github.com
git config user.name "$GITHUB_TRIGGERING_ACTOR (via github-actions)"
git config user.email "${{ inputs.actor-email }}"
./apply-headers.sh
git commit -am "SPDX headers added by SecHub release job @github-actions" || true
COMMITS=`git log --oneline --branches --not --remotes`
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/release-wrapper-checkmarx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Release Checkmarx wrapper
on:
workflow_dispatch:
inputs:
actor-email:
description: Insert your email address here. It will be used in the generated pull requests
checkmarx-wrapper-version:
description: Checkmarx-wrapper Version (e.g. 1.0.0)
required: true
Expand All @@ -17,6 +19,7 @@ jobs:
steps:
- name: "Show Inputs"
run: |
echo "actor-email: '${{ inputs.actor-email }}'"
echo "Checkmarx-wrapper '${{ inputs.checkmarx-wrapper-version }}' - Milestone '${{ inputs.checkmarx-wrapper-milestone-number }}'"
- name: Checkout branch master
Expand All @@ -37,16 +40,20 @@ jobs:
with:
java-version: 17
distribution: temurin
cache: gradle

- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false

# ----------------------
# Create a pull request if license headers are missing
# ----------------------
- name: run apply-headers.sh
id: apply-headers
run: |
git config user.name "SecHub release job (github-actions)"
git config user.email github-actions-sechub@users.noreply.github.com
git config user.name "$GITHUB_TRIGGERING_ACTOR (via github-actions)"
git config user.email "${{ inputs.actor-email }}"
./apply-headers.sh
git commit -am "SPDX headers added by SecHub release job @github-actions" || true
COMMITS=`git log --oneline --branches --not --remotes`
Expand Down
Loading

0 comments on commit 092b015

Please sign in to comment.