Skip to content

Commit

Permalink
Add pypi publishing workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Mancini committed Jan 26, 2024
1 parent 9793113 commit 22c0c3d
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Kit4DL package to PyPI

on:
release:
types: [published]
workflow_dispatch:

jobs:
build-and-publish:
name: Build Kit4DL and publish to PyPI
strategy:
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install build tool
run: python3 -m pip install build --user
- name: Build wheels
run: python -m build --sdist --wheel --outdir=dist/ .
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
44 changes: 44 additions & 0 deletions .github/workflows/testpypi_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish geokube package to TestPyPI

on:
release:
types: [prereleased]
workflow_dispatch:

jobs:
build-and-publish:
name: Build geokube and publish to TestPyPI
strategy:
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]
# environment:
# name: testpypi
# url: https://test.pypi.org/p/geokube
permissions:
id-token: write
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install build tool
run: python3 -m pip install build --user
- name: Build wheels
run: python -m build --sdist --wheel --outdir=dist/ .
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/geokube
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
# retrieve your distributions here

0 comments on commit 22c0c3d

Please sign in to comment.