Skip to content

Commit

Permalink
Post build checks (#27)
Browse files Browse the repository at this point in the history
* bump version to 0.9.6

* Corrected workflow file
  • Loading branch information
williamjameshandley authored Nov 25, 2023
1 parent b247785 commit 8c28272
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 16 deletions.
77 changes: 63 additions & 14 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@ on:
branches:
- master
jobs:
git-tag-and-release:
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.step1.outputs.v }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Get version number
run: |
VERSION="$(grep ':Version:' README.rst | awk '{print $2}')"
echo "DIST_VERSION=v${VERSION}" >> $GITHUB_ENV
id: step1
run: echo "v=$(grep ':Version:' README.rst | awk '{print $2}')" >> $GITHUB_OUTPUT

git-tag-and-release:
runs-on: ubuntu-latest
needs: get_version
steps:
- uses: actions/checkout@v4
- name: set version number
run: echo "DIST_VERSION=v${{ needs.get-version.outputs.version }}" >> $GITHUB_ENV
- name: Create Tag
uses: actions/github-script@v6
with:
Expand All @@ -34,7 +43,7 @@ jobs:
pypi-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
Expand All @@ -49,18 +58,15 @@ jobs:
password: ${{ secrets.PYPI_API_TOKEN }}

pypi-public:
needs: pypi-release
needs:
- get-version
- pypi-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get version number
run: |
VERSION="$(grep ':Version:' README.rst | awk '{print $2}')"
echo "VERSION_NUMBER=${VERSION}" >> $GITHUB_ENV
- name: Wait for PyPi
uses: nev7n/wait_for_response@v1
with:
url: "https://files.pythonhosted.org/packages/source/l/lsbi/lsbi-${{ env.VERSION_NUMBER }}.tar.gz"
url: "https://files.pythonhosted.org/packages/source/l/lsbi/lsbi-${{ needs.get-version.outputs.version }}.tar.gz"
responseCode: 200
timeout: 600000
interval: 10000
Expand All @@ -69,7 +75,7 @@ jobs:
needs: pypi-public
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -117,3 +123,46 @@ jobs:
user: handley-lab
label: 'main'
token: ${{ secrets.ANACONDA_TOKEN }} # Replace with the right name of your secret

conda-build:
needs:
- conda-release
- get-version
name: test installation from conda
runs-on: ubuntu-latest
steps:
- name: Conda environment creation and activation
uses: conda-incubator/setup-miniconda@v2
with:
python-version: '3.9'
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: install from conda
shell: bash -el {0}
run: conda install -c handley-lab lsbi
- name: get install version
shell: bash -el {0}
run: echo "install_version=$(python -c 'import lsbi; print(lsbi.__version__)')" >> $GITHUB_ENV
- name: fail if versions not matching
if: ${{ env.install_version != needs.get-version.outputs.version }}
run: exit 1

pypi-build:
needs:
- pypi-public
- get-version
name: test installation from pypi
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install from pypi
run: pip install lsbi
- name: get install version
run: echo "install_version=$(python -c 'import lsbi; print(lsbi.__version__)')" >> $GITHUB_ENV
- name: fail if versions not matching
if: ${{ env.install_version != needs.get-version.outputs.version }}
run: exit 1
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ lsbi: Linear Simulation Based Inference
=======================================
:lsbi: Linear Simulation Based Inference
:Author: Will Handley & David Yallup
:Version: 0.9.5
:Version: 0.9.6
:Homepage: https://github.com/handley-lab/lsbi
:Documentation: http://lsbi.readthedocs.io/

Expand Down
2 changes: 1 addition & 1 deletion lsbi/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.9.5"
__version__ = "0.9.6"

0 comments on commit 8c28272

Please sign in to comment.