Skip to content

Commit

Permalink
Add Github actions for automated release to PyPI, including automatic…
Browse files Browse the repository at this point in the history
… version bump
  • Loading branch information
loostrum committed Jun 11, 2021
1 parent aba7955 commit 5035fd3
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
push:
branches:
- master

jobs:
release-on-push:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- id: release
uses: rymndhng/[email protected]
with:
bump_version_scheme: patch

pypi-deploy:
runs-on: ubuntu-latest
# run only on successful release
needs: release-on-push
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up python
uses: actions/[email protected]
with:
python-version: 3.8
architecture: x64
- name: Build
env:
VERSION: ${{ needs.release-on-push.release.outputs.version }}
run: |
pip install wheel
echo "__version__ = '$VERSION'" >> frbcat/__version__.py
python setup.py sdist bdist_wheel
- name: Deploy
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
1 change: 1 addition & 0 deletions frbcat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
from .frbcat_file import Frbcat
from .chime_repeaters import ChimeRepeaters
from .tns import TNS
from .__version__ import __version__
1 change: 1 addition & 0 deletions frbcat/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = 'github'
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
"""Installation setup of the frbcat python package."""
import os
from setuptools import setup

with open(os.path.join('frbcat', '__version__.py')) as f:
version = {}
exec(f.read(), version)
project_version = version['__version__']


setup(name='frbcat',
version='0.2.16',
version=project_version,
description='Query the FRB catalogue',
url='http://github.com/davidgardenier/frbcat',
author='David Gardenier',
Expand Down

0 comments on commit 5035fd3

Please sign in to comment.