Skip to content

Commit

Permalink
Add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Milk committed Oct 5, 2024
1 parent 69dab60 commit 1d0fcd1
Showing 1 changed file with 34 additions and 36 deletions.
70 changes: 34 additions & 36 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Linux dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get install -y openslide-tools
- name: Install MacOS dependencies
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install openslide
- name: Install Project dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -45,32 +37,38 @@ jobs:
run: |
pytest tests/
# Upload_to_test_pypi:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.10'
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install flit
# pip install .
Upload_to_pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

# - name: Publish to test.ipynb pypi
# env:
# FLIT_INDEX_URL: https://test.ipynb.pypi.org/legacy/
# FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }}
# FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: flit publish || exit 0
#
# - name: Publish to pypi
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# env:
# FLIT_INDEX_URL: https://upload.pypi.org/legacy/
# FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }}
# FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: flit publish
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Install Hatch
uses: pypa/hatch@install

- name: Publish to test pypi
env:
HATCH_INDEX_REPO: https://test.pypi.org/legacy/
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TEST_TOKEN }}
run: |
hatch build
hatch publish || exit 0
- name: Publish to pypi
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
env:
HATCH_INDEX_REPO: https://upload.pypi.org/legacy/
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
run: |
hatch build
hatch publish

0 comments on commit 1d0fcd1

Please sign in to comment.