Skip to content

Commit

Permalink
adding create release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mgonzs13 committed Feb 21, 2025
1 parent 6806a49 commit b181d7a
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Create Release

on:
push:
branches: [main]

jobs:
create_release:
if: startsWith(github.event.head_commit.message, 'new version')

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Extract version from commit message
run: |
# Get the version from the commit message using a regex
if [[ "${{ github.event.head_commit.message }}" =~ new\ version\ ([0-9]+\.[0-9]+\.[0-9]+) ]]; then
echo "version=${BASH_REMATCH[1]}" >> $GITHUB_ENV
else
echo "Commit message does not match 'new version *.*.*' format."
exit 1
fi
- name: Get previous tag
run: |
previous_tag=$(git describe --tags --abbrev=0 HEAD^)
echo "previous_tag=$previous_tag" >> $GITHUB_ENV
- name: Generate release notes with commit messages
run: |
commits=$(git log "${{ env.previous_tag }}..HEAD" --oneline)
echo "release_body<<EOF" >> $GITHUB_ENV
echo "### Changelog from version ${{ env.previous_tag }} to ${{ env.version }}:" >> $GITHUB_ENV
echo "$commits" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create GitHub release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "${{ env.version }}"
release_name: "${{ env.version }}"
body: "${{ env.release_body }}"
draft: false
prerelease: false
4 changes: 3 additions & 1 deletion yolo_ros/yolo_ros/detect_3d_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ def process_detections(
return []

new_detections = []
depth_image = self.cv_bridge.imgmsg_to_cv2(depth_msg, desired_encoding="passthrough")
depth_image = self.cv_bridge.imgmsg_to_cv2(
depth_msg, desired_encoding="passthrough"
)

for detection in detections_msg.detections:
bbox3d = self.convert_bb_to_3d(depth_image, depth_info_msg, detection)
Expand Down

0 comments on commit b181d7a

Please sign in to comment.