Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update version to v0.5.0 #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/update-caret-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Update Version and Create PR

on:
push:
tags:
- v*

jobs:
update-version-and-create-pr:
permissions:
actions: write
checks: write
contents: write
deployments: write
issues: write
packages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write

runs-on: ubuntu-latest
steps:
- name: Set up Git
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- name: Get New Branch and Tag
id: tag
run: |
# latest_tag=$(curl -s https://api.github.com/repos/${GITHUB_REPOSITORY}/tags | jq -r .[0].name)
latest_tag=$(curl -s https://api.github.com/repos/tier4/caret_trace/tags | jq -r .[0].name)
current_tag=${{ github.ref_name }}
branch=rc/$current_tag
echo "LATEST_TAG_NAME=$latest_tag" >> "$GITHUB_OUTPUT"
echo "TAG_NAME=$current_tag" >> "$GITHUB_OUTPUT"
echo "BRANCH_NAME=$branch" >> "$GITHUB_OUTPUT"
- name: Checkout repository2
uses: actions/checkout@v4
with:
ref: ${{ steps.tag.outputs.BRANCH_NAME }}

- name: Commit and push changes
run: |
sed -i "s|<version>.*</version>|<version>$(echo "${{ steps.tag.outputs.TAG_NAME }}" | sed 's/^.//')</version>|" caret_msgs/package.xml
git add caret_msgs/package.xml
sed -i "s|<version>.*</version>|<version>$(echo "${{ steps.tag.outputs.TAG_NAME }}" | sed 's/^.//')</version>|" CARET_trace/package.xml
git add CARET_trace/package.xml
git commit -m "chore: update package.xml version to ${{ steps.tag.outputs.TAG_NAME }}" -s
git push origin ${{ steps.tag.outputs.BRANCH_NAME }}
- name: Re-create tag
run: |
git push -d origin ${{ steps.tag.outputs.TAG_NAME }}
git tag ${{ steps.tag.outputs.TAG_NAME }}
git push origin ${{ steps.tag.outputs.TAG_NAME }}
- name: Create PR to main branch if the created tag is the latest
run: |
if [ ${{ steps.tag.outputs.LATEST_TAG_NAME }} == ${{ steps.tag.outputs.TAG_NAME }} ]; then
gh pr create --title "chore: update version to ${{ steps.tag.outputs.TAG_NAME }}" \
--body "This pull request updates the version in package.xml to ${{ steps.tag.outputs.TAG_NAME }}" \
--base main \
--head ${{ steps.tag.outputs.BRANCH_NAME }}
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion CARET_trace/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>caret_trace</name>
<version>0.4.22</version>
<version>0.5.0</version>
<description>Library to add tracepoints for CARET</description>
<maintainer email="[email protected]">ymski</maintainer>
<maintainer email="[email protected]">isp-uetsuki</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion caret_msgs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>caret_msgs</name>
<version>0.4.22</version>
<version>0.5.0</version>
<description>Message definitions for CARET</description>
<maintainer email="[email protected]">ymski</maintainer>
<maintainer email="[email protected]">isp-uetsuki</maintainer>
Expand Down