diff --git a/.github/templates/.release_notes.md.j2 b/.github/templates/.release_notes.md.j2 index 6c12e9b..3736ef6 100644 --- a/.github/templates/.release_notes.md.j2 +++ b/.github/templates/.release_notes.md.j2 @@ -3,8 +3,17 @@ ## Release Notes {% include ".changes.j2" %} {{ "**Full Changelog**: (%s)" | format(prev_version | compare_url(version)) }} + ## Installation + You can install this version via pip from [PyPI](https://pypi.org/project/python-re3data/{{ version }}/): + ```console python -m pip install python-re3data=={{ version }} ``` + +or pull the Docker image from [ghcr.io](https://github.com/afuetterer/python-re3data/pkgs/container/python-re3data): + +```console +docker pull ghcr.io/afuetterer/python-re3data:{{ version }} +``` diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0ce4e57..e3db93b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -38,3 +38,45 @@ jobs: path: dist - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14 + + docker: + name: Publish Docker image to ghcr.io + # disables this workflow from running in a repository that is not part of the indicated organization/user + if: github.repository_owner == 'afuetterer' + runs-on: ubuntu-24.04 + needs: build + permissions: + contents: read + packages: write + env: + IMAGE_NAME: ${{ github.repository }} + steps: + - uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 + - name: Login to GitHub Container Registry + uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Generate Docker image metadata + id: meta + # Ref: https://github.com/docker/metadata-action?tab=readme-ov-file#customizing + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + with: + images: ghcr.io/${{ env.IMAGE_NAME }} + flavor: latest=true + tags: | + type=pep440,pattern={{version}} + type=pep440,pattern={{major}}.{{minor}} + - name: Build and push image to registry + # Ref: https://github.com/docker/build-push-action?tab=readme-ov-file#customizing + uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0 + with: + push: true + build-args: VERSION=${{ github.event.release.name }} + cache-from: type=gha + cache-to: type=gha,mode=max + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + # Ref: https://docs.docker.com/build/attestations/slsa-provenance/ + provenance: false diff --git a/README.md b/README.md index adcd619..9a1fb76 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,12 @@ You can install `python-re3data` via pip from [PyPI][pypi-url]: python -m pip install python-re3data ``` +or pull the Docker image from [ghcr.io](https://github.com/afuetterer/python-re3data/pkgs/container/python-re3data): + +```console +docker pull ghcr.io/afuetterer/python-re3data:latest +``` + ## Documentation The [documentation][docs-url] is made with [Material for MkDocs](https://github.com/squidfunk/mkdocs-material) and is