Skip to content

another attempt at publishing packages via GA #7

another attempt at publishing packages via GA

another attempt at publishing packages via GA #7

name: Python package
on:
push:
tags:
- "v*.*.*"
jobs:
# test_package:
# uses: ./.github/workflows/test_package.yml
build:
# needs: test_package
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Build the package
run: poetry build
- name: Mint token
id: mint-token
run: |

Check failure on line 34 in .github/workflows/publish_package.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish_package.yml

Invalid workflow file

You have an error in your yaml syntax on line 34
# retrieve the ambient OIDC token
resp=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=pypi")
oidc_token=$(jq '.value' <<< "${resp}")
# exchange the OIDC token for an API token
resp=$(curl -X POST https://pypi.org/_/oidc/mint-token -d "{\"token\": \"${oidc_token}\"}")
api_token=$(jq '.token' <<< "${resp}")
# mask the newly minted API token, so that we don't accidentally leak it
echo "::add-mask::${api_token}"
# see the next step in the workflow for an example of using this step output
echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
- name: Publish package
env:
PYPI_TOKEN: ${{ outputs.api-token }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish