Skip to content

Commit

Permalink
ci: adapt pipeline workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
samikachai committed Dec 15, 2024
1 parent 17cf10c commit 1034345
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 37 deletions.
35 changes: 13 additions & 22 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,35 +45,26 @@ jobs:
cat TEMP.md >> CHANGELOG.md
rm TEMP.md
- name: Fetch initial commit history
id: fetch_initial_commit_history
run: |
echo "::set-output name=history::$(cat initial_commit_history.md)"
- name: Update changelog
- name: Insert initial commit history
run: |
TARGET_TAG="0.0.1"
CHANGELOG_FILE="CHANGELOG.md"
INITIAL_HISTORY="${{ steps.fetch_initial_commit_history.outputs.history }}"
FILE="CHANGELOG.md"
ESCAPED_HISTORY=$(printf '%s\n' "$INITIAL_HISTORY" | sed 's/[&/\]/\\&/g')
INITIAL_COMMIT_HISTORY="${{ env.INITIAL_COMMIT_HISTORY }}"
if grep -q "## $TARGET_TAG (" "$CHANGELOG_FILE"; then
echo "Tag ## $TARGET_TAG found. Updating $CHANGELOG_FILE..."
sed -i "/## $TARGET_TAG (/,/^## /{//!d}" "$CHANGELOG_FILE"
if grep -q "^## $TARGET_TAG " "$FILE"; then
sed -i "/^## $TARGET_TAG /,/^## /{//!d}" "$FILE"
awk -v tag="## $TARGET_TAG " -v history="$INITIAL_HISTORY" '
{
print;
if ($0 ~ tag) {
print history;
}
}' "$CHANGELOG_FILE" > TEMP.md && mv TEMP.md "$CHANGELOG_FILE"
awk -v content="$INITIAL_COMMIT_HISTORY" -v tag="## $TARGET_TAG " '
BEGIN { found=0 }
$0 ~ tag { print; print content; found=1; next }
{ print }
END { if (!found) print "Tag header not found!" }
' "$FILE" > TEMP.md && mv TEMP.md "$FILE"
echo "Initial commit history inserted under ## $TARGET_TAG."
echo "Initial commit history inserted under the ## $TARGET_TAG header in $FILE."
else
echo "Error: Tag ## $TARGET_TAG not found in $CHANGELOG_FILE."
exit 1
echo "Tag ## $TARGET_TAG not found in $FILE."
fi
- name: Commit changelog changes
Expand Down
30 changes: 15 additions & 15 deletions initial_commit_history.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
-Initial commit
Initial commit

-Update LICENSE
Update LICENSE

-Update README
Update README

-Create CODEOWNERS
Create CODEOWNERS

-Jest configuration and initial unit tests
Jest configuration and initial unit tests

-Implement TrafficSigns
Implement TrafficSigns

-Improve logic to prevent TrafficSign rerender
Improve logic to prevent TrafficSign rerender

-Synchronize OSI extension code
Synchronize OSI extension code

-Fix trafficsign category modelCache
Fix trafficsign category modelCache

-Traffic Lights Implementation
Traffic Lights Implementation

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

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

-Remove old unneeded manually created types (#9)
Remove old unneeded manually created types (#9)

-Migrate from npm to yarn (#10)
Migrate from npm to yarn (#10)

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

0 comments on commit 1034345

Please sign in to comment.