Merge pull request #3 from sonicfieldlabs/codex/audit-backend-v0.6.5 #3
Workflow file for this run
This file contains hidden or 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 stack | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build and verify distributions | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Oída | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| path: oida | |
| - name: Checkout AKOÚŌ contract | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| repository: sonicfieldlabs/akouo | |
| ref: v0.7.0 | |
| path: akouo | |
| - name: Checkout Earworm | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| repository: sonicfieldlabs/earworm | |
| ref: v0.4.0 | |
| path: earworm | |
| - name: Checkout Akousmata | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| repository: sonicfieldlabs/akousmata | |
| ref: v0.4.0 | |
| path: akousmata | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| with: | |
| python-version: "3.12" | |
| - name: Verify release tag and project version | |
| working-directory: oida | |
| run: | | |
| release_version="${GITHUB_REF_NAME#v}" | |
| project_version="$(uv version --short)" | |
| test "$release_version" = "$project_version" | |
| - name: Build all canonical distributions | |
| run: | | |
| mkdir -p release/akouo release/akousma release/akousmata release/oida | |
| uv build --out-dir "$GITHUB_WORKSPACE/release/akouo" akouo | |
| uv build --out-dir "$GITHUB_WORKSPACE/release/akousma" earworm/packages/py-akousma | |
| uv build --out-dir "$GITHUB_WORKSPACE/release/akousmata" akousmata | |
| uv build --out-dir "$GITHUB_WORKSPACE/release/oida" oida | |
| - name: Check distribution metadata | |
| run: uv run --project oida --extra dev twine check release/*/* | |
| - name: Verify Oída wheel in an isolated environment | |
| run: | | |
| cd "$RUNNER_TEMP" | |
| uv run --isolated --no-project \ | |
| --find-links "$GITHUB_WORKSPACE/release/akouo" \ | |
| --find-links "$GITHUB_WORKSPACE/release/akousma" \ | |
| --find-links "$GITHUB_WORKSPACE/release/akousmata" \ | |
| --with "$GITHUB_WORKSPACE"/release/oida/sonicfield_oida-*.whl \ | |
| python -c 'import oida, oida.server; print(oida.__version__)' | |
| - name: Upload verified distributions | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: python-distributions | |
| path: release | |
| if-no-files-found: error | |
| retention-days: 7 | |
| publish: | |
| name: Publish ${{ matrix.project }} to PyPI | |
| needs: build | |
| if: ${{ vars.PYPI_PUBLISH_ENABLED == 'true' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - project: akouo-contract | |
| directory: akouo | |
| environment: pypi | |
| - project: akousma | |
| directory: akousma | |
| environment: pypi-akousma | |
| - project: akousmata | |
| directory: akousmata | |
| environment: pypi-akousmata | |
| runs-on: ubuntu-latest | |
| environment: ${{ matrix.environment }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Download verified distributions | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: python-distributions | |
| path: release | |
| - name: Publish ${{ matrix.project }} | |
| uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 | |
| with: | |
| packages-dir: release/${{ matrix.directory }} | |
| skip-existing: true | |
| publish-oida: | |
| name: Publish sonicfield-oida to PyPI | |
| needs: | |
| - build | |
| - publish | |
| if: ${{ vars.PYPI_PUBLISH_ENABLED == 'true' && vars.PYPI_OIDA_PUBLISH_ENABLED == 'true' }} | |
| runs-on: ubuntu-latest | |
| environment: pypi-sonicfield-oida | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Download verified distributions | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: python-distributions | |
| path: release | |
| - name: Publish sonicfield-oida | |
| uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 | |
| with: | |
| packages-dir: release/oida | |
| skip-existing: true |