Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/publish-pypi-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish to PyPI - Test Wheels

on: [push, pull_request]

jobs:
build_and_test_wheels:
runs-on: ubuntu-latest
environment: release
strategy:
matrix:
python-version: ["3.12"]

steps:

- name: Checkout
uses: actions/checkout@v4
with:
# Need this to get version number from last tag
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Build sdist and wheel
run: >
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) &&
pipx run build

- name: Check for packaging errors
run: pipx run twine check --strict dist/*

- name: Install produced wheel
run: pip install dist/*.whl

- name: Test module is importable using the installed wheel - 1
run: python -c "import save_and_restore_api"

- name: Test module is importable using the installed wheel - 2
run: python -c "from save_and_restore_api import SaveRestoreAPI"

- name: Test module is importable using the installed wheel - 3
run: python -c "from save_and_restore_api.aio import SaveRestoreAPI"

- name: Test if save-and-restore tools can be started
run: save-and-restore -h
38 changes: 29 additions & 9 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
name: Publish to PyPI

on:
release:
types: [created]
branches:
- main
release:
types: [created]
branches:
- main

jobs:
upload:
build_and_upload_to_pypi:
runs-on: ubuntu-latest
environment: release
strategy:
matrix:
python-version: ["3.12"]

steps:
- name: Download dist artifact
uses: actions/download-artifact@v4

- name: Checkout
uses: actions/checkout@v4
with:
# Need this to get version number from last tag
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
name: dist
path: dist
python-version: ${{ matrix.python-version }}

- name: Build sdist and wheel
run: >
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) &&
pipx run build

- name: Check for packaging errors
run: pipx run twine check --strict dist/*

- name: Install produced wheel
run: pip install dist/*.whl

- name: Publish to PyPI using trusted publishing
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down