Skip to content

Commit

Permalink
Unify version information
Browse files Browse the repository at this point in the history
  • Loading branch information
croots committed Nov 21, 2024
1 parent c7fc2ff commit 0af684a
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 3 deletions.
48 changes: 46 additions & 2 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Python distribution to TestPyPI
name: Publish Python distribution to PyPI

on:
workflow_dispatch:
Expand Down Expand Up @@ -31,12 +31,13 @@ jobs:

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
name: pypi
url: https://test.pypi.org/p/<package-name>

permissions:
Expand All @@ -52,3 +53,46 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
6 changes: 5 additions & 1 deletion ostir/ostir.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from warnings import warn
from pathlib import Path
from .shortcuts import from_csv
from importlib.metadata import version


try:
Expand All @@ -30,7 +31,10 @@
else:
rprint = None

OSTIR_VERSION = '1.1.1'
try:
OSTIR_VERSION = version('ostir')
except:
OSTIR_VERSION = 'Unknown'
OLDEST_VIENNA = '2.6.4'

# The E. coli sequence
Expand Down

0 comments on commit 0af684a

Please sign in to comment.