publish_nightly #1041
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
# This script takes a nightly snapshot of the main branch and uploads it to pypi | |
name: publish_nightly | |
on: | |
# Run nightly | |
schedule: | |
- cron: "0 7 * * *" | |
# Allows you to run this workflow manually from the Actions tab (for debugging) | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out repository under $GITHUB_WORKSPACE, so job can access it | |
- uses: actions/checkout@v2 | |
# Overwrites the nightly branch with main branch. Replaces prod seqio strings. | |
# Pushes new nightly | |
- name: Merge main branch into nightly branch and update package info | |
run: | | |
git config user.email "[email protected]@google.com" | |
git config user.name "SeqIO Team" | |
git fetch | |
git checkout nightly | |
git reset --hard main | |
now=$(date +'%Y%m%d') | |
sed -i "$ s/.$/\.dev$now'/" seqio/version.py | |
sed -i "/name=/s/'.*'/'seqio-nightly'/" setup.py | |
sed -i "/url=/s/'.*'/'https:\/\/github.com\/google\/seqio\/tree\/nightly'/" setup.py | |
git add * | |
git commit -m "Updated nightly 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.PYPI_API_TOKEN }} |