diff --git a/.github/workflows/cd_release.yml b/.github/workflows/cd_release.yml index 1e48430..32be842 100644 --- a/.github/workflows/cd_release.yml +++ b/.github/workflows/cd_release.yml @@ -6,7 +6,7 @@ on: - published jobs: - publish-package-and-docs: + build: name: External uses: SINTEF/ci-cd/.github/workflows/cd_release.yml@v2.8.2 if: github.repository == 'SINTEF/oteapi-optimade' && startsWith(github.ref, 'refs/tags/v') @@ -21,8 +21,11 @@ jobs: release_branch: main install_extras: "[dev]" python_version_build: "3.9" - build_cmd: "pip install -U flit && flit build" - publish_on_pypi: true + build_libs: flit + build_cmd: "flit build" + build_dir: "dist" + publish_on_pypi: false + upload_distribution: true # Documentation update_docs: true @@ -31,5 +34,29 @@ jobs: changelog_exclude_labels: "skip_changelog,duplicate,question,invalid,wontfix" secrets: - PyPI_token: ${{ secrets.PYPI_TOKEN }} PAT: ${{ secrets.RELEASE_PAT }} + + publish: + name: Publish to PyPI + needs: build + runs-on: ubuntu-latest + + # Using environments is recommended by PyPI when using Trusted Publishers + environment: + name: pypi + url: https://pypi.org/project/oteapi-optimade + + # The id-token:write permission is required by the PyPI upload action for + # Trusted Publishers + permissions: + id-token: write + + steps: + - name: Download distribution + uses: actions/download-artifact@v4 + with: + name: dist # The artifact will always be called 'dist' + path: dist + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b961d2..564bbca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [Unreleased](https://github.com/SINTEF/oteapi-optimade/tree/HEAD) + +[Full Changelog](https://github.com/SINTEF/oteapi-optimade/compare/v0.5.1...HEAD) + +**Fixed bugs:** + +- Use Trusted Publishers with PyPI [\#252](https://github.com/SINTEF/oteapi-optimade/issues/252) + +## [v0.5.1](https://github.com/SINTEF/oteapi-optimade/tree/v0.5.1) (2024-09-03) + +[Full Changelog](https://github.com/SINTEF/oteapi-optimade/compare/v0.5.0...v0.5.1) + +## Update to latest dependencies + +Update dependencies to support the latest core libraries. + +This release is done almost immediately prior to the v0.6.0.dev0 release, which will support the upcoming re-design of OTEAPI Core and the use of sessions. + +**Merged pull requests:** + +- Use Trusted Publishers for publishing on PyPI [\#253](https://github.com/SINTEF/oteapi-optimade/pull/253) ([CasperWA](https://github.com/CasperWA)) + ## [v0.5.0](https://github.com/SINTEF/oteapi-optimade/tree/v0.5.0) (2024-03-07) [Full Changelog](https://github.com/SINTEF/oteapi-optimade/compare/v0.4.2...v0.5.0) diff --git a/oteapi_optimade/__init__.py b/oteapi_optimade/__init__.py index bdc9767..0f27984 100644 --- a/oteapi_optimade/__init__.py +++ b/oteapi_optimade/__init__.py @@ -10,7 +10,7 @@ import logging -__version__ = "0.5.0" +__version__ = "0.5.1" __author__ = "Casper Welzel Andersen" __author_email__ = "casper.w.andersen@sintef.no"