forked from mercedes-benz/sechub
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (88 loc) · 3.6 KB
/
publish-libraries.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# SPDX-License-Identifier: MIT
name: Publish libraries
on:
workflow_dispatch:
inputs:
libraries-version:
description: Libraries Version (e.g. 1.0.0)
required: true
milestone-number:
description: Milestone number for release(s)
default: 20
required: true
jobs:
release-version:
name: Build, publish and release
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v3
with:
ref: master
# Create temporary local tags, so we build documentation for this tag...
# The final tag on git server side will be automatically done by the release step at the end
# automatically.
- name: "Temporary tag libraries version: v${{ github.event.inputs.libraries-version }}-libraries"
run: git tag v${{ github.event.inputs.libraries-version }}-libraries
# Build
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
cache: gradle
- name: Build
run: ./gradlew clean build -x :sechub-integrationtest:test -x :sechub-cli:build
- name: Create combined test report
if: always()
run: ./gradlew createCombinedTestReport
# To identifiy parts not in git history and leading to "-dirty-$commitId" markers
- name: Inspect GIT status
if: always()
run: git status > build/reports/git-status.txt
# -----------------------------------------
# Upload Build Artifacts (only test output)
# -----------------------------------------
- name: Archive combined test report
if: always()
uses: actions/upload-artifact@v3
with:
name: combined-sechub-testreport
path: build/reports/combined-report
retention-days: 14
- name: Archive GIT status
if: always()
uses: actions/upload-artifact@v3
with:
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
- 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
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v${{ github.event.inputs.libraries-version }}-libraries
commitish: master
release_name: Libraries Version ${{ github.event.inputs.libraries-version }}
body: |
New library artifacts can be found at https://github.com/mercedes-benz/sechub/packages
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