Skip to content

Commit f6837b7

Browse files
Add proper tagging strategy for license checker (#26)
* Add proper tagging strategy for license checker --------- Signed-off-by: Dennis Meister <[email protected]>
1 parent c1560e3 commit f6837b7

File tree

2 files changed

+77
-2
lines changed

2 files changed

+77
-2
lines changed

.github/workflows/create-tag.yml

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copyright (c) 2023 Robert Bosch GmbH
2+
#
3+
# This program and the accompanying materials are made available under the
4+
# terms of the Apache License, Version 2.0 which is available at
5+
# https://www.apache.org/licenses/LICENSE-2.0.
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10+
# License for the specific language governing permissions and limitations
11+
# under the License.
12+
#
13+
# SPDX-License-Identifier: Apache-2.0
14+
15+
name: Create/update tag
16+
on:
17+
workflow_dispatch:
18+
push:
19+
tags:
20+
- 'v[0-9]+\.[0-9]+\.[0-9]+'
21+
jobs:
22+
create-tag:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v3
26+
- name: Get version from setup.py
27+
id: getVersions
28+
run: |
29+
semantic_version=$(python setup.py --version)
30+
major_version=$(cut -d '.' -f 1 <<< "$semantic_version")
31+
major_minor_version=$(cut -d '.' -f 1,2 <<< "$semantic_version")
32+
echo "semantic_version=v$semantic_version" >> $GITHUB_OUTPUT
33+
echo "major_version=v$major_version" >> $GITHUB_OUTPUT
34+
echo "major_minor_version=v$major_minor_version" >> $GITHUB_OUTPUT
35+
36+
- name: Check manual created tag
37+
id: manualTag
38+
if: github.ref_type == 'tag'
39+
run: |
40+
if [ "${GITHUB_REF#refs/*/}" != ${{ steps.getVersions.outputs.semantic_version }} ]; then
41+
echo "Please align desired tag: '${GITHUB_REF#refs/*/}' ${{ github.ref }} with setup.py version '${{ steps.getVersions.outputs.semantic_version }}'"
42+
echo "Deleting manual created tag"
43+
git push --delete origin ${GITHUB_REF#refs/*/}
44+
exit 1
45+
else
46+
echo "All fine"
47+
fi
48+
49+
- name: Create full version tag - ${{ steps.getVersions.outputs.semantic_version }}
50+
uses: rickstaa/action-create-tag@v1
51+
id: "tag_create_full_version"
52+
with:
53+
tag: ${{ steps.getVersions.outputs.semantic_version }}
54+
tag_exists_error: true
55+
force_push_tag: false
56+
message: "${{ steps.getVersions.outputs.semantic_version }}"
57+
58+
- name: Create major.minor version tag - ${{ steps.getVersions.outputs.major_minor_version }}
59+
uses: rickstaa/action-create-tag@v1
60+
id: "tag_create_major_minor"
61+
with:
62+
tag: ${{ steps.getVersions.outputs.major_minor_version }}
63+
tag_exists_error: false
64+
force_push_tag: true
65+
message: "${{ steps.getVersions.outputs.major_minor_version }}"
66+
67+
- name: Create major version tag - ${{ steps.getVersions.outputs.major_version }}
68+
uses: rickstaa/action-create-tag@v1
69+
id: "tag_create_major"
70+
with:
71+
tag: ${{ steps.getVersions.outputs.major_version }}
72+
tag_exists_error: false
73+
force_push_tag: true
74+
message: "${{ steps.getVersions.outputs.major_version }}"

NOTICE-3RD-PARTY-CONTENT.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
## Python
44
| Dependency | Version | License |
55
|:-----------|:-------:|--------:|
6-
|certifi|2022.12.7|Mozilla Public License 2.0|
6+
|certifi|2023.5.7|Mozilla Public License 2.0|
77
|charset-normalizer|3.1.0|MIT|
88
|gitdb|4.0.10|BSD|
99
|GitPython|3.1.31|BSD|
1010
|idna|3.4|BSD|
1111
|PyYAML|6.0|MIT|
12-
|requests|2.29.0|Apache 2.0|
12+
|requests|2.30.0|Apache 2.0|
1313
|smmap|5.0.0|BSD|
1414
|str2bool|1.1|BSD|
1515
|urllib3|1.26.15|MIT|
@@ -18,3 +18,4 @@
1818
|:-----------|:-------:|--------:|
1919
|actions/checkout|v3|MIT License|
2020
|github/codeql-action|v1|MIT License|
21+
|rickstaa/action-create-tag|v1|MIT License|

0 commit comments

Comments
 (0)