Add temp token. #2
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: Release | |
on: | |
push: | |
branches: | |
- release | |
jobs: | |
run_test_suite_workflow: | |
uses: ./.github/workflows/test_suite.yml | |
with: | |
branch: release | |
setup_poetry_and_publish_to_pypi: | |
runs-on: ubuntu-latest | |
needs: run_test_suite_workflow | |
steps: | |
- name: Checkout code on release | |
uses: actions/checkout@v4 | |
with: | |
ref: release | |
- name: Install Poetry | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Configure GITHUB_TOKEN for Poetry | |
run: git config --global url."https://github.com/".insteadOf "[email protected]:" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate lock file | |
run: poetry lock | |
- name: Install dependencies | |
run: poetry install --no-root --with dev | |
- name: Build Python package and publish to PyPI | |
if: ${{ needs.run_test_suite_workflow.result == 'success' }} | |
env: | |
PYPI_TEMP_TOKEN: ${{ secrets.PYPI_TEMP_TOKEN }} # TODO: Set a new token in remote repo settings | |
run: poetry publish --build -u __token__ -p $PYPI_TEMP_TOKEN |