feat: Update README.md by combining the best changes from branches (#… #334
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: Release and PyPI Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| release-and-publish: | |
| runs-on: ubuntu-latest | |
| concurrency: release | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.ADMIN_TOKEN }} | |
| - name: Check if should skip | |
| id: check_skip | |
| run: | | |
| if [ "$(git log -1 --pretty=format:'%an')" = "OpenAdapt Bot" ]; then | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Set up Python | |
| if: steps.check_skip.outputs.skip != 'true' | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| if: steps.check_skip.outputs.skip != 'true' | |
| run: pip install poetry | |
| - name: Python Semantic Release | |
| if: steps.check_skip.outputs.skip != 'true' | |
| id: release | |
| uses: python-semantic-release/python-semantic-release@v10.5.3 | |
| with: | |
| github_token: ${{ secrets.ADMIN_TOKEN }} | |
| git_committer_name: "OpenAdapt Bot" | |
| git_committer_email: "bot@openadapt.ai" | |
| - name: Build and publish to PyPI | |
| if: steps.check_skip.outputs.skip != 'true' && steps.release.outputs.released == 'true' | |
| env: | |
| PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
| run: | | |
| git pull | |
| poetry config pypi-token.pypi $PYPI_TOKEN | |
| poetry build | |
| poetry publish --no-interaction --skip-existing |