Deprecations in BioPython #16
Workflow file for this run
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
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI | |
# source: | |
# - https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | |
# - https://docs.pypi.org/trusted-publishers/using-a-publisher/ | |
# - https://github.com/marketplace/actions/pypi-publish | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*.*.*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
build_dist: | |
name: Build Python 🐍 distributions 📦 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
lfs: false | |
# NOTE to save on bandwidth costs, GitHub Action will not use GitHub's own LFS | |
- name: Fetch test-data | |
# NOTE to save on bandwidth costs, pull data from BSSE's GitLab LFS instead | |
run: | | |
git config --file .lfsconfig lfs.url "https://git.bsse.ethz.ch/cbg/viruses/smallgenomeutilities.git/info/lfs" | |
git lfs install | |
git lfs pull | |
git lfs checkout | |
- name: Git archive | |
run: | | |
git archive --format=tar --prefix='smgu/' HEAD | (cd /tmp; tar xf -) | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install pypa/build | |
run: >- | |
python3 -m | |
pip install | |
build | |
--user | |
- name: Build a binary wheel and a source tarball from the Git archive | |
run: >- | |
python3 -m | |
build | |
--sdist | |
--wheel | |
--outdir dist/ | |
/tmp/smgu/ | |
- name: Archive distributions 📦 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: | | |
dist | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
files: | | |
dist/* | |
# publish_testpypi: | |
# name: Publish Python 🐍 distributions 📦 to TestPyPI | |
# runs-on: ubuntu-latest | |
# | |
# needs: build_dist | |
# | |
# permissions: | |
# # IMPORTANT: this permission is mandatory for trusted publishing | |
# id-token: write | |
# | |
# environment: | |
# name: testpypi | |
# url: https://test.pypi.org/p/smallgenomeutilities | |
# | |
# steps: | |
# - name: Fetch distributions 📦 | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: dist | |
# path: dist | |
# | |
# - name: Publish distribution 📦 to Test PyPI | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# repository-url: https://test.pypi.org/legacy/ | |
# skip-existing: true | |
publish_pypi: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
name: Publish Python 🐍 distributions 📦 to PyPI | |
runs-on: ubuntu-latest | |
needs: | |
- build_dist | |
# - publish_testpypi | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
environment: | |
name: pypi | |
url: https://pypi.org/p/smallgenomeutilities | |
steps: | |
- name: Fetch distributions 📦 | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
print-hash: true |