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
52 changes: 30 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,58 @@
name: publish
# Workflow created according to: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
name: Publish to PyPI and TestPyPI


on:
push:
# build the package on any push to a release-candidate branch
branches: [ "release/rc_v*" ]
# deploy to test-pypi on any push of a version tag
tags: [ "v*" ]
release:
# deploy to pypi when publishing a new release
types: [ published ]
types: [ "published" ]

jobs:
publish:
build-n-publish:
name: Build and publish Python distributions to PyPI and TestPyPI
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- uses: actions/checkout@v7
- name: Check out repository
uses: actions/checkout@v7

- uses: actions/setup-python@v7
- name: Set up python
id: setup-python
uses: actions/setup-python@v6
with:
python-version: "3.14"

#------------------------------
# install & configure poetry
#------------------------------

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.1.2
version: 2.1.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install poetry dynamic versioning plugin
run: poetry self add "poetry-dynamic-versioning[plugin]"

- name: Build package
run: poetry build

- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.TESTPYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
#------------------------------
# publish to pypi
#------------------------------

- if: github.event_name == 'release'
name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
if: github.event_name == 'release'
- if: github.event_name != 'release'
name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ dependencies = [
"wquantiles>=0.6",
"XlsxWriter>=3.0.3",
]
dynamic = []
version = "3.4.0.post3.dev0+603330e"
dynamic = ["version"]

[tool.poetry]
documentation = "https://pyam-iamc.readthedocs.io"
packages = [{ include = "pyam" }]
requires-poetry = ">=2.0,<3.0"
version = "0.0.0"

[tool.poetry.group.dev]
optional = true
Expand Down Expand Up @@ -183,6 +183,6 @@ max-complexity = 10
poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = ["plugin"] }

[tool.poetry-dynamic-versioning]
enable = false
enable = true
style = "pep440"
vcs = "git"
Loading