mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
feat: update version to 0.6.2. added Action to update pyproject on Release (#2552)
* updated version; added Action to update pyproject version by current tag (if changed) * higer pyproject version creates a tag now * Release-only run to write tag to pyproject
This commit is contained in:
48
.github/workflows/update-pyproject-version.yml
vendored
Normal file
48
.github/workflows/update-pyproject-version.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Update pyproject.toml Version and Tags
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
update-pyproject-and-tags:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for all branches and tags
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install toml
|
||||
|
||||
- name: Get release tag
|
||||
id: get_release_tag
|
||||
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Update pyproject.toml with release tag
|
||||
run: |
|
||||
python -c "
|
||||
import toml
|
||||
with open('pyproject.toml', 'r') as f:
|
||||
data = toml.load(f)
|
||||
data['tool']['poetry']['version'] = '${{ env.RELEASE_TAG }}'
|
||||
with open('pyproject.toml', 'w') as f:
|
||||
toml.dump(data, f)
|
||||
"
|
||||
|
||||
- name: Commit and push pyproject.toml changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: "Update pyproject.toml version to ${{ env.RELEASE_TAG }}"
|
||||
branch: main
|
||||
file_pattern: pyproject.toml
|
||||
Reference in New Issue
Block a user