-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,54 @@ | ||
name: Upload package to PyPI | ||
name: Upload Package to PyPI | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
|
||
jobs: | ||
publish: | ||
name: Publish to PyPI | ||
build: | ||
name: Build packages | ||
runs-on: ubuntu-latest | ||
# container: ghcr.io/osgeo/gdal:alpine-normal-latest | ||
container: ghcr.io/osgeo/gdal:ubuntu-full-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ '3.11' ] | ||
if: github.repository == 'umr-lops/grdwindinversion' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Update | ||
run: | | ||
apt-get update | ||
apt-get -y install software-properties-common | ||
add-apt-repository -y ppa:deadsnakes/ppa | ||
apt-get -y install libgeos-dev | ||
apt-get update | ||
- name: Set up Python ${{ matrix.python-version }} | ||
run: | | ||
apt-get install -y --no-install-recommends \ | ||
python${{ matrix.python-version }} \ | ||
python${{ matrix.python-version }}-dev \ | ||
python${{ matrix.python-version }}-venv \ | ||
python3-pip \ | ||
g++ | ||
chown -R $(whoami) /github/home/ | ||
# - name: Set up Python | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: '3.x' | ||
python-version: "3.x" | ||
- name: Install dependencies | ||
run: | | ||
python${{ matrix.python-version }} -m pip install --upgrade pip build twine | ||
python -m pip install --upgrade pip | ||
python -m pip install build twine | ||
- name: Build | ||
run: | | ||
python${{ matrix.python-version }} -m build --sdist . | ||
python -m build --sdist --outdir dist/ . | ||
- name: Check the built archives | ||
run: | | ||
twine check dist/* | ||
python${{ matrix.python-version }} -m pip install dist/*.whl | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
password: ${{ secrets.pypi_token }} | ||
repository_url: https://upload.pypi.org/legacy/ | ||
verify_metadata: true | ||
name: packages | ||
path: dist/* | ||
|
||
pypi-publish: | ||
name: Upload to PyPI | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/grdwindinversion | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages | ||
path: dist/ | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e |