Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and upload to PyPI | |
on: | |
release: | |
types: [published] | |
jobs: | |
publish: | |
runs-on: ubuntu-22.04 | |
permissions: | |
id-token: write # mandatory for PyPI trusted publishing | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version-file: pyproject.toml | |
architecture: x64 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: install handlebars | |
run: | | |
npm install -g handlebars | |
- name: Build packages | |
run: | | |
pip install -U pip build | |
python -m build --sdist --wheel | |
- name: Upload to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1.8 | |
# dont specify anything for Trusted Publishing | |
# https://docs.pypi.org/trusted-publishers | |
# with: | |
# # Using token | |
# user: __token__ | |
# password: ${{ secrets.PYPI_API_TOKEN }} | |
# | |
# # Using token on test index | |
# password: ${{ secrets.PYPI_TEST_API_TOKEN }} | |
# repository_url: https://test.pypi.org/legacy/ | |
- name: Build and push Docker image | |
uses: openzim/docker-publish-action@v10 | |
with: | |
image-name: openzim/nautilus | |
tag-pattern: /^v([0-9.]+)$/ | |
latest-on-tag: true | |
restrict-to: openzim/nautilus | |
registries: ghcr.io | |
credentials: | |
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }} | |
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }} | |
repo_description: auto | |
repo_overview: auto |