Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Binyang2014 committed Jan 2, 2025
1 parent 1d8d0bc commit 5d74d56
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Update Version
on:
pull_request:
branches:
- main
- release/**
paths:
- 'VERSION'

jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Read version
id: read_version
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV

- name: Update Version in Files
run: |
VERSION=${{ env.VERSION }}
sed -i "s/^version: .*/version: ${VERSION}/" CITATION.cff
sed -i "s/^release = \".*\"/release = \"v${VERSION}\"/" conf.py
sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" pyproject.toml
# Update header file
IFS='.' read -ra VER <<< "$VERSION"
MAJOR=${VER[0]}
MINOR=${VER[1]}
PATCH=${VER[2]}
sed -i "s/#define MSCCLPP_MAJOR .*/#define MSCCLPP_MAJOR ${MAJOR}/" include/mscclpp/core.hpp
sed -i "s/#define MSCCLPP_MINOR .*/#define MSCCLPP_MINOR ${MINOR}/" include/mscclpp/core.hpp
sed -i "s/#define MSCCLPP_PATCH .*/#define MSCCLPP_PATCH ${PATCH}/" include/mscclpp/core.hpp
- name: Commit and Push Changes
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add CITATION.cff conf.py mscc.hpp
git commit -m "Update version to ${{ env.VERSION }}"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.6.0

0 comments on commit 5d74d56

Please sign in to comment.