diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index dcec3cd..0a94231 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -1,13 +1,13 @@ -# Written following the guide: +# Modified from the original version of: # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ -name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI +name: Publish 📦 to PyPI and TestPyPI on: push jobs: build: - name: Build distribution 📦 + name: Build distribution runs-on: ubuntu-latest steps: @@ -30,27 +30,91 @@ jobs: name: python-package-distributions path: dist/ + publish-to-pypi: + name: >- + Publish distribution to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/coolest # Replace with your PyPI project name + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Upload to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + github-release: + name: >- + Sign the distribution with Sigstore + and upload them to GitHub Release + needs: + - publish-to-pypi + runs-on: ubuntu-latest + + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + id-token: write # IMPORTANT: mandatory for sigstore + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Sign the dists with Sigstore + uses: sigstore/gh-action-sigstore-python@v1.2.3 + with: + inputs: >- + ./dist/*.tar.gz + ./dist/*.whl + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release create + '${{ github.ref_name }}' + --repo '${{ github.repository }}' + --notes "" + - name: Upload artifact signatures to GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + # Upload to GitHub Release using the `gh` CLI. + # `dist/` contains the built packages, and the + # sigstore-produced signatures and certificates. + run: >- + gh release upload + '${{ github.ref_name }}' dist/** + --repo '${{ github.repository }}' + publish-to-testpypi: - name: Publish Python 🐍 distribution 📦 to TestPyPI + name: Publish distribution to TestPyPI # unlike for PyPI, releases on any push on TestPyPI needs: - build runs-on: ubuntu-latest environment: name: testpypi - url: https://test.pypi.org/p/ + url: https://test.pypi.org/p/coolest permissions: id-token: write # IMPORTANT: mandatory for trusted publishing steps: - - name: Download all the dists + - name: Download the dists uses: actions/download-artifact@v3 with: name: python-package-distributions path: dist/ - - name: Publish distribution 📦 to TestPyPI + - name: Upload to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ - diff --git a/HISTORY.md b/HISTORY.md index 9086e60..35fa65c 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,12 @@ -# CHANGELOG +# Official releases -## 04/10/22 +## v0.1.0 (2023-08-02) + +- Version corresponding to the JOSS publication + +# Older changes + +## 04-10-22 - The `ExternalShear` object has been replaced ba a more general `MassField` object. This is for supporting higher-order lensing fields such as flexion in the future. The two supported types of `LensingEntity` are thus `Galaxy` and `MassField`. @@ -9,7 +15,7 @@ - The single parameter of the `GaussianPSF` has changed from the standard deviation `std_dev` to the more widely used full width at half maximum `fwhm`. -## 14/10/22 +## 14-10-22 ### Major changes: @@ -23,7 +29,7 @@ - a 'DOC' mode has been added to the root COOLEST class (for usage with the documentation website, see separate repository) -## 02/06/22 +## 02-06-22 ### Major changes @@ -44,7 +50,7 @@ These affect the template structure: - COOLEST standard now supports two distinct modes: 'MAP' to store model results, and 'MOCK' for simulating an observation -## 31/05/22 +## 31-05-22 ### Major changes Theese affect the template structure: diff --git a/coolest/__init__.py b/coolest/__init__.py index 53993a2..0d8c43e 100644 --- a/coolest/__init__.py +++ b/coolest/__init__.py @@ -6,19 +6,19 @@ """ # Set the package release version -version_info = (0, 1, 0) +version_info = (0, 1, 2) __version__ = '.'.join(str(c) for c in version_info) # Set the package details __author__ = 'COOLEST developers' __email__ = 'aymeric.galan@gmail.com' -__year__ = '2021-2023' +__year__ = '2021-2024' __credits__ = 'COOLEST developers' __url__ = 'https://github.com/aymgal/COOLEST' __description__ = 'Standard for Strong Gravitational Lens Modeling' # Default package properties -__license__ = 'MIT' +__license__ = 'GPL-3.0' __about__ = ('{} Author: {}, Email: {}, Year: {}, {}' ''.format(__name__, __author__, __email__, __year__, __description__)) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..fed528d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 7507149..065a04f 100644 --- a/setup.py +++ b/setup.py @@ -12,6 +12,7 @@ this_directory = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() + readme = f.read() # Python version python_requires = '>=3.7'