cicd: bump version to 0.0.37 #38. #32
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: Publish Python 馃悕 distribution 馃摝 to PyPI and TestPyPI | |
on: | |
push: | |
tags: | |
- "v*" # Push events to matching v*.*.* tags | |
env: # FIXME: env cannot be passed down to jobs defined as workflow call what?! https://github.com/orgs/community/discussions/26671 - this is annoying. | |
CONTENT_DIR: omniverse # the directory where the book's content is stored | |
WEBSITE: www.gaohongnan.com | |
WORKING_DIRECTORY: "." | |
BANDIT_OUTPUT_FILENAME: "bandit_results.log" | |
RUFF_OUTPUT_FILENAME: "ruff_results.log" | |
ISORT_OUTPUT_FILENAME: "isort_results.log" | |
BLACK_OUTPUT_FILENAME: "black_results.log" | |
MYPY_OUTPUT_FILENAME: "mypy_results.log" | |
UNIT_TEST_OUTPUT_FILENAME: "unit_test_results.log" | |
jobs: | |
setup-env-vars: # FIXME: see env comment. | |
runs-on: ubuntu-latest | |
outputs: | |
working-directory: ${{ env.WORKING_DIRECTORY }} | |
bandit-output-filename: ${{ env.BANDIT_OUTPUT_FILENAME }} | |
ruff-output-filename: ${{ env.RUFF_OUTPUT_FILENAME }} | |
isort-output-filename: ${{ env.ISORT_OUTPUT_FILENAME }} | |
black-output-filename: ${{ env.BLACK_OUTPUT_FILENAME }} | |
mypy-output-filename: ${{ env.MYPY_OUTPUT_FILENAME }} | |
unit-test-output-filename: ${{ env.UNIT_TEST_OUTPUT_FILENAME }} | |
steps: | |
- run: echo "Exposing env vars to reusable workflows." | |
continuous-integration: | |
needs: setup-env-vars | |
uses: ./.github/workflows/_continuous_integration.yaml | |
with: | |
working-directory: ${{ needs.setup-env-vars.outputs.working-directory }} | |
bandit-output-filename: ${{ needs.setup-env-vars.outputs.bandit-output-filename }} | |
ruff-output-filename: ${{ needs.setup-env-vars.outputs.ruff-output-filename }} | |
isort-output-filename: ${{ needs.setup-env-vars.outputs.isort-output-filename }} | |
black-output-filename: ${{ needs.setup-env-vars.outputs.black-output-filename }} | |
mypy-output-filename: ${{ needs.setup-env-vars.outputs.mypy-output-filename }} | |
unit-test-output-filename: ${{ needs.setup-env-vars.outputs.unit-test-output-filename }} | |
secrets: inherit | |
build: | |
name: Build distribution 馃摝 | |
runs-on: ubuntu-latest | |
needs: continuous-integration | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install pypa/build | |
run: >- | |
python -m | |
pip install | |
build | |
--user | |
- name: Build a binary wheel and a source tarball | |
run: python -m build | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v3 | |
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/omniverse | |
permissions: | |
id-token: write # Mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution 馃摝 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
github-release: | |
name: >- | |
Sign the Python 馃悕 distribution 馃摝 with Sigstore | |
and upload them to GitHub Release | |
needs: publish-to-pypi | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # Mandatory for making GitHub Releases | |
id-token: write # Mandatory for sigstore | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Sign the dists with Sigstore | |
uses: sigstore/gh-action-sigstore-python@v1.2.3 | |
with: | |
inputs: >- | |
./dist/*.tar.gz | |
./dist/*.whl | |
- name: Create GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: >- | |
gh release create | |
'${{ github.ref_name }}' | |
--repo '${{ github.repository }}' | |
--notes "" | |
- name: Upload artifact signatures to GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: >- | |
gh release upload | |
'${{ github.ref_name }}' dist/** | |
--repo '${{ github.repository }}' | |
publish-to-testpypi: | |
name: Publish Python 馃悕 distribution 馃摝 to TestPyPI | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/p/omniverse | |
permissions: | |
id-token: write # Mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v3 | |
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/ | |
release-docker: | |
needs: [publish-to-pypi, publish-to-testpypi] | |
uses: ./.github/workflows/release_docker.yaml | |
secrets: inherit |