inputs fine-tuned #2
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: PyPI publish | ||
on: | ||
workflow_call: | ||
inputs: | ||
package_version: | ||
description: "The version used to publish to the registry." | ||
required: true | ||
test_pypi: "Parameter to publish the package to Test PyPI when set to 'true', and to publish to official Pypi when set to 'false'." | ||
required: true | ||
jobs: | ||
build-package: | ||
name: Build Package with Verified Version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Validate Version Tag | ||
uses: ghga-de/gh-action-pypi/verify-version-tag@v1.0.1 | ||
with: | ||
tag: ${{ inputs.package_version }} | ||
- name: Build Python Package | ||
uses: ghga-de/gh-action-pypi/build-python-package@v1.0.1 | ||
- name: Upload package artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./dist | ||
test-package: | ||
name: Test Freshly Built Package | ||
needs: build-package | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download dist content | ||
uses: actions/download-artifact@v4 | ||
- name: Test the test-package action | ||
uses: ghga-de/gh-action-pypi/test-package@v1.0.1 | ||
with: | ||
python_version: ${{ matrix.python-version }} | ||
publish-package: | ||
name: Publish Package | ||
needs: test-package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download dist content | ||
uses: actions/download-artifact@v4 | ||
- name: Test the publish-package action | ||
uses: ghga-de/gh-action-pypi/publish-package@v1.0.1 | ||
with: | ||
test_pypi_api_token: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
pypi_api_token: ${{ secrets.PYPI_API_TOKEN }} | ||
test_pypi: ${{ inputs.test_pypi }} |