| name: Python SDK Beta Release |
|
|
| permissions: |
| contents: read |
|
|
| on: |
| workflow_dispatch: |
| push: |
| branches: |
| - main |
|
|
| jobs: |
| release-beta-sdk: |
| name: Python SDK Beta Release |
| runs-on: depot-ubuntu-latest-8 |
| environment: dev |
|
|
| steps: |
| - name: Checkout repository |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 |
| with: |
| persist-credentials: false |
|
|
| - name: Get short SHA |
| id: get-short-sha |
| run: | |
| echo "id=${GITHUB_SHA:0:12}" >> "$GITHUB_OUTPUT" |
| |
| |
| - name: Set up Nix |
| uses: nixbuild/nix-quick-install-action@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c |
| with: |
| github_access_token: ${{ secrets.GITHUB_TOKEN }} |
| nix_conf: | |
| access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} |
| keep-env-derivations = true |
| keep-outputs = true |
| |
| - name: Restore Nix store |
| uses: nix-community/cache-nix-action/restore@7df957e333c1e5da7721f60227dbba6d06080569 |
| with: |
| primary-key: ${{ runner.os }}-openmeter-nix-build-${{ github.ref_name }}-${{ hashFiles('flake.*') }} |
| restore-prefixes-first-match: | |
| ${{ runner.os }}-openmeter-nix-build-${{ github.ref_name }}- |
| ${{ runner.os }}-openmeter-nix-build-main-${{ hashFiles('flake.*') }} |
| ${{ runner.os }}-openmeter-nix-build-main- |
| ${{ runner.os }}-openmeter-nix-build- |
| |
| - name: Publish Python package via Nix make target |
| run: | |
| nix develop --impure .#ci -c make -C api/client/python publish-python-sdk |
| env: |
| PY_SDK_RELEASE_TAG: alpha |
| COMMIT_SHORT_SHA: ${{ steps.get-short-sha.outputs.id }} |
| POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} |
|
|