Skip to content

Commit 20e9ded

Browse files
authoredDec 15, 2024
ci: adapt pipeline workflow (#31)
1 parent 17cf10c commit 20e9ded

File tree

2 files changed

+28
-37
lines changed

2 files changed

+28
-37
lines changed
 

‎.github/workflows/release.yaml

+13-22
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,26 @@ jobs:
4545
cat TEMP.md >> CHANGELOG.md
4646
rm TEMP.md
4747
48-
- name: Fetch initial commit history
49-
id: fetch_initial_commit_history
50-
run: |
51-
echo "::set-output name=history::$(cat initial_commit_history.md)"
52-
53-
- name: Update changelog
48+
- name: Insert initial commit history
5449
run: |
5550
TARGET_TAG="0.0.1"
56-
CHANGELOG_FILE="CHANGELOG.md"
57-
INITIAL_HISTORY="${{ steps.fetch_initial_commit_history.outputs.history }}"
51+
FILE="CHANGELOG.md"
5852
59-
ESCAPED_HISTORY=$(printf '%s\n' "$INITIAL_HISTORY" | sed 's/[&/\]/\\&/g')
53+
INITIAL_COMMIT_HISTORY="${{ env.INITIAL_COMMIT_HISTORY }}"
6054
61-
if grep -q "## $TARGET_TAG (" "$CHANGELOG_FILE"; then
62-
echo "Tag ## $TARGET_TAG found. Updating $CHANGELOG_FILE..."
63-
sed -i "/## $TARGET_TAG (/,/^## /{//!d}" "$CHANGELOG_FILE"
55+
if grep -q "^## $TARGET_TAG " "$FILE"; then
56+
sed -i "/^## $TARGET_TAG /,/^## /{//!d}" "$FILE"
6457
65-
awk -v tag="## $TARGET_TAG " -v history="$INITIAL_HISTORY" '
66-
{
67-
print;
68-
if ($0 ~ tag) {
69-
print history;
70-
}
71-
}' "$CHANGELOG_FILE" > TEMP.md && mv TEMP.md "$CHANGELOG_FILE"
58+
awk -v content="$INITIAL_COMMIT_HISTORY" -v tag="## $TARGET_TAG " '
59+
BEGIN { found=0 }
60+
$0 ~ tag { print; print content; found=1; next }
61+
{ print }
62+
END { if (!found) print "Tag header not found!" }
63+
' "$FILE" > TEMP.md && mv TEMP.md "$FILE"
7264
73-
echo "Initial commit history inserted under ## $TARGET_TAG."
65+
echo "Initial commit history inserted under the ## $TARGET_TAG header in $FILE."
7466
else
75-
echo "Error: Tag ## $TARGET_TAG not found in $CHANGELOG_FILE."
76-
exit 1
67+
echo "Tag ## $TARGET_TAG not found in $FILE."
7768
fi
7869
7970
- name: Commit changelog changes

‎initial_commit_history.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
-Initial commit
1+
Initial commit
22

3-
-Update LICENSE
3+
Update LICENSE
44

5-
-Update README
5+
Update README
66

7-
-Create CODEOWNERS
7+
Create CODEOWNERS
88

9-
-Jest configuration and initial unit tests
9+
Jest configuration and initial unit tests
1010

11-
-Implement TrafficSigns
11+
Implement TrafficSigns
1212

13-
-Improve logic to prevent TrafficSign rerender
13+
Improve logic to prevent TrafficSign rerender
1414

15-
-Synchronize OSI extension code
15+
Synchronize OSI extension code
1616

17-
-Fix trafficsign category modelCache
17+
Fix trafficsign category modelCache
1818

19-
-Traffic Lights Implementation
19+
Traffic Lights Implementation
2020

21-
-Create release with artifact on new tag (#3)
21+
Create release with artifact on new tag (#3)
2222

23-
-Integrate ASAM OSI as Dependency for OSI Ground Truth Extension (#5)
23+
Integrate ASAM OSI as Dependency for OSI Ground Truth Extension (#5)
2424

25-
-Remove old unneeded manually created types (#9)
25+
Remove old unneeded manually created types (#9)
2626

27-
-Migrate from npm to yarn (#10)
27+
Migrate from npm to yarn (#10)
2828

29-
-Install @lichtblick/asam-osi-types npm package and update imports. (#16)
29+
Install @lichtblick/asam-osi-types npm package and update imports. (#16)

0 commit comments

Comments
 (0)
Please sign in to comment.