Skip to content

Dockerfile: implement user UID/GID logic #100

Dockerfile: implement user UID/GID logic

Dockerfile: implement user UID/GID logic #100

Workflow file for this run

---
name: Build and Publish Release to PyPI & GitHub
on: push
jobs:
build:
name: Build distribution πŸ“¦
runs-on: ubuntu-latest
steps:
- name: Checkout repository πŸ›’
uses: actions/checkout@v4
- name: Update version in pyproject.toml ⬆️
uses: brettdorrans/[email protected]
with:
filename: 'pyproject.toml'
placeholder: '1.0.0.dev1'
- name: Set up Python 3.12 🐍
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install and configure Poetry πŸ“œ
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Build & Package project πŸ‘·
run: poetry build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish-to-pypi:
name: Publish Python 🐍 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/withings-sync
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution πŸ“¦ to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }} # LEAVING THIS HERE UNTIL TRUSTED PUBLISHING IS IN PLACE
publish-to-github-release:
name: Upload the Python 🐍 distribution to GitHub Release
if: startsWith(github.ref, 'refs/tags/') # only upload to GitHub Release on tag pushes
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Release
uses: fnkr/github-action-ghr@v1
env:
GHR_PATH: dist/
GHR_REPLACE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-to-testpypi:
name: Publish Python 🐍 distribution πŸ“¦ to TestPyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/withings-sync
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution πŸ“¦ to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true