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: Semantic Release and PyPI Publish | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
concurrency: release | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.ADMIN_TOKEN }} # Use the new token for authentication | |
- name: Python Semantic Release | |
id: semantic_release | |
uses: relekang/python-semantic-release@master | |
with: | |
github_token: ${{ secrets.ADMIN_TOKEN }} # Use the new token for authentication | |
git_committer_name: "OpenAdapt Bot" | |
git_committer_email: "bot@openadapt.ai" | |
publish: | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: Publish to PyPI | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
pip install poetry | |
poetry install | |
poetry config pypi-token.pypi $PYPI_TOKEN | |
poetry build | |
poetry publish --no-interaction --skip-existing |