Skip to content

publish_monthly

publish_monthly #33

# This script increments the version and uploads SeqIO to pypi on the 1st of every month
name: publish_monthly
on:
# Run on the first day of the month at UTC+7
schedule:
- cron: "0 7 1 * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checks-out repository under $GITHUB_WORKSPACE, so job can access it
- uses: actions/checkout@v2
# Get current version, increment by 1
# Replace in version.py
# Push and publish to PyPI
- name: Merge main branch into release branch and update package info
run: |
git config user.email "[email protected]"
git config user.name "SeqIO Team"
git fetch
git checkout release
git reset --hard main
version=$(tail -1 seqio/version.py | sed 's/.*\.//'| sed 's/.$//')
newversion=$((version+1))
sed -i "$ s/"$version"/"$newversion"/" "seqio/version.py"
git add *
git commit -m "Updated maintenance version"
git push --force
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.MONTHLY_PYPI_API_TOKEN }}