Skip to content

Commit

Permalink
Merge pull request #286 from CSHS-CWRA/fix_publish_actions
Browse files Browse the repository at this point in the history
Update publishing workflows to reflect new structure
  • Loading branch information
Zeitsperre authored May 26, 2023
2 parents 5388c66 + 02571b4 commit 4162afa
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 39 deletions.
45 changes: 20 additions & 25 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,28 @@ name: Publish Python 🐍 distributions 📦 to PyPI

on:
release:
types: [ published ]
types:
- published

jobs:
build-n-publish-pypi:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install GDAL
run: |
sudo apt-get update
sudo apt-get install libgdal-dev
- name: Set GDAL version
run: |
echo "GDAL_VERSION=$(gdal-config --version)" >> $GITHUB_ENV
- name: Install packaging libraries
run: pip install wheel
- name: Build a binary wheel and a source tarball
run: |
export LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6:$LD_PRELOAD
python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install packaging libraries
run: pip install flit
- name: Build a binary wheel and a source tarball
run: flit build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
22 changes: 8 additions & 14 deletions .github/workflows/tag-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,20 @@ on:
jobs:
build-n-publish-testpypi:
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install GDAL
run: |
sudo apt-get update
sudo apt-get install libgdal-dev
- name: Set GDAL version
run: |
echo "GDAL_VERSION=$(gdal-config --version)" >> $GITHUB_ENV
python-version: ${{ matrix.python-version }}
- name: Install packaging libraries
run: pip install wheel
run: pip install flit
- name: Build a binary wheel and a source tarball
run: |
export LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6:$LD_PRELOAD
python setup.py sdist bdist_wheel
run: flit build
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down

0 comments on commit 4162afa

Please sign in to comment.