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
50 changes: 50 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish to PyPI

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Check release tag matches package version
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PKG_VERSION="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml","rb"))["tool"]["poetry"]["version"])')"
echo "Release tag version: $TAG_VERSION"
echo "Package version: $PKG_VERSION"
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "::error::Release tag ($TAG_VERSION) does not match pyproject.toml version ($PKG_VERSION)"
exit 1
fi

- name: Build
run: |
python -m pip install --upgrade pip build
python -m build

- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

publish:
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # required for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- uses: pypa/gh-action-pypi-publish@release/v1
18 changes: 17 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
[tool.poetry]
name = "refractiveindex"
version = "1.0.2"
version = "1.0.3"
description = "A python interface to the refractiveindex.info database."
authors = ["Ivan Toftul <toftul.ivan@gmail.com>"]
readme = "README.md"
license = "MIT"
homepage = "https://github.com/toftul/refractiveindex"
repository = "https://github.com/toftul/refractiveindex"
keywords = ["optics", "refractive index", "photonics", "materials", "refractiveindex.info"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Physics",
]

[tool.poetry.dependencies]
python = "^3.10"
Expand Down
Loading