Skip to content

Commit

Permalink
Merge a7b0826 into f2ba792
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Feb 8, 2024
2 parents f2ba792 + a7b0826 commit 6d0fc40
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
PYTEST_ADDOPTS: "--durations=0"
run: poetry run pytest --cov janus_core --cov-append .

- name: Report coverage to Coveralls
uses: coverallsapp/github-action@v2

docs:
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/publish-on-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish on PyPI

on:
push:
tags:
# After vMajor.Minor.Patch _anything_ is allowed (without "/") !
- v[0-9]+.[0-9]+.[0-9]+*

jobs:
publish:
runs-on: ubuntu-latest
if: github.repository == 'stfc/janus-core' && startsWith(github.ref, 'refs/tags/v')

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Build project for distribution
run: poetry build

- name: Check Version
id: check-version
run: |
[[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || echo prerelease=true >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: steps.check-version.outputs.prerelease == 'true'
skipIfReleaseExists: true

- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ packages = [{include = "janus_core"}]
classifiers = [
"Programming Language :: Python",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD 3-Clause License",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Development Status :: 3 - Alpha",
]
Expand Down
3 changes: 3 additions & 0 deletions tests/test_example.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"""Example test."""

import janus_core


def test_example():
"""
Example test.
"""
print(janus_core.__version__)
assert 1 == (2 / 2)

0 comments on commit 6d0fc40

Please sign in to comment.