Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,22 @@ jobs:
runs-on: ubuntu-latest
permissions:
pull-requests: write
strategy:
matrix:
python-version: ["3.11"]
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: 3.11
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
python -m pip install pandas
python -m pip install pydot
python -m pip install Pillow
python -m pip install pandas pydot Pillow
- name: Generate coverage report
run: |
python -m pip install pytest
python -m pip install pytest-cov
python -m pip install pytest pytest-cov
pytest --cov=./ --cov-report=xml
- name: Convert coverage report
uses: irongut/CodeCoverageSummary@v1.3.0
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/conda-publish.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Docs

on:
workflow_run:
workflows: ["Upload Python Package to PyPI"]
workflows: ["Upload Python Package"]
branches: [master]
types:
- completed
Expand All @@ -17,6 +17,7 @@ jobs:
- name: Check if upstream workflow failed
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
run: exit 1

docs:
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand All @@ -27,9 +26,7 @@ jobs:
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
python -m pip install pandas
python -m pip install pydot
python -m pip install Pillow
python -m pip install pandas pydot Pillow
- name: Lint with flake8
run: |
python -m pip install flake8
Expand Down
43 changes: 37 additions & 6 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Upload Python Package to PyPI
name: Upload Python Package

on: workflow_dispatch

permissions: write-all

jobs:
deploy:
create-release:
runs-on: ubuntu-latest
outputs:
VERSION_NUMBER: ${{ steps.set-env-var-version.outputs.VERSION_NUMBER }}
SHA256: ${{ steps.set-env-var-sha256.outputs.SHA256 }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand All @@ -18,23 +21,51 @@ jobs:
python -m pip install --upgrade pip
pip install hatch
- name: Set env var
id: set-env-var
id: set-env-var-version
run: |
VERSION_NUMBER=
echo "VERSION_NUMBER=$(python -c 'import bigtree; print(bigtree.__version__)')" >> $GITHUB_OUTPUT
echo VERSION_NUMBER=$(python -c 'import bigtree; print(bigtree.__version__)') >> $GITHUB_OUTPUT
- name: Create release
uses: ncipollo/release-action@v1
env:
VERSION_NUMBER: ${{ steps.set-env-var.outputs.VERSION_NUMBER }}
VERSION_NUMBER: ${{ steps.set-env-var-version.outputs.VERSION_NUMBER }}
with:
name: v${{ env.VERSION_NUMBER }}
tag: ${{ env.VERSION_NUMBER }}
generateReleaseNotes: true
makeLatest: true
- name: Set env var 2
id: set-env-var-sha256
env:
VERSION_NUMBER: ${{ steps.set-env-var-version.outputs.VERSION_NUMBER }}
run: |
echo SHA256=$(curl -sL https://github.com/kayjan/bigtree/archive/${VERSION_NUMBER}.tar.gz | openssl sha256 | sed 's/.*(stdin)= //') >> $GITHUB_OUTPUT

publish-to-pypi:
runs-on: ubuntu-latest
needs: create-release
steps:
- name: Build package
run: hatch build
- name: Publish package
env:
HATCH_USER: ${{ secrets.HATCH_USER }}
HATCH_AUTH: ${{ secrets.HATCH_AUTH }}
run: hatch publish -u $HATCH_USER -a $HATCH_AUTH

publish-to-conda:
runs-on: ubuntu-latest
needs: create-release
steps:
- uses: actions/checkout@v3
- name: Set up Conda
run: |
conda install -c conda-forge conda-build conda-verify anaconda-client
- name: Publish to conda
env:
ANACONDA_API_TOKEN: ${{ secrets.CONDA_TOKEN }}
VERSION_NUMBER: ${{ needs.create-release.outputs.VERSION_NUMBER }}
SHA256: ${{ needs.create-release.outputs.SHA256 }}
run: |
cd conda
conda config --set anaconda_upload yes
conda build -c conda-forge --output-folder . .