-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Weekly Release | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 1' # Runs every Sunday at 00:00 UTC | ||
|
||
jobs: | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Fetch all commits to get accurate version number | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine bumpversion | ||
- name: Update version number | ||
run: | | ||
# Update the version number in setup.py and __init__.py | ||
bumpversion --current-version $(python setup.py --version) --new-version $(bumpversion --list minor --new-minor-version --no-commit | grep new_minor_version | sed 's/new_minor_version=//') minor setup.py nanodl/__init__.py | ||
# Configure Git user | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
# Commit the version changes | ||
git add setup.py nanodl/__init__.py | ||
git commit -m "Bump version" | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
- name: Git tag | ||
run: | | ||
git tag v$(python setup.py --version) | ||
git push origin v$(python setup.py --version) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters