Skip to content

Commit

Permalink
Add dev tagging to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
justincdavis committed Oct 11, 2024
1 parent 8ab8955 commit e60898d
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion .github/workflows/test-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,35 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install build toml
- name: Update version in pyproject.toml
run: |
python3 << END
import toml
import os
from datetime import datetime
# Read the current pyproject.toml
with open('pyproject.toml', 'r') as f:
config = toml.load(f)
# Get the current version
current_version = config['project']['version']
# Create a unique version using GitHub run number and current date
run_number = os.environ['GITHUB_RUN_NUMBER']
current_date = datetime.now().strftime("%Y%m%d")
new_version = f"{current_version}.dev{current_date}{run_number}"
# Update the version in the config
config['project']['version'] = new_version
# Write the updated config back to pyproject.toml
with open('pyproject.toml', 'w') as f:
toml.dump(config, f)
print(f"Updated version to {new_version}")
END
- name: Build oakutils
run: |
python -m build --sdist --wheel --outdir dist/
Expand Down

0 comments on commit e60898d

Please sign in to comment.