release-package #6
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-package | |
| on: | |
| workflow_run: | |
| workflows: ["CI"] | |
| types: | |
| - completed | |
| branches: | |
| - main | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release and Publish | |
| uses: python-semantic-release/python-semantic-release@v10.1.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| root_options: "--config ./pyproject.toml" | |
| git_committer_name: "github-actions[bot]" | |
| git_committer_email: "github-actions[bot]@users.noreply.github.com" | |
| - name: Install Rye | |
| run: | | |
| curl -sSf https://rye.astral.sh/get | bash | |
| echo "$HOME/.rye/shims" >> $GITHUB_PATH | |
| env: | |
| RYE_VERSION: '0.44.0' | |
| RYE_INSTALL_OPTION: '--yes' | |
| - name: Publish to PyPI | |
| run: | | |
| make upload | |
| env: | |
| PYPI_TOKEN: ${{ secrets.EVOLUTION_PYPI_TOKEN || secrets.PYPI_TOKEN }} | |
| deploy-docs: | |
| name: Deploy Sphinx documentation to Pages | |
| runs-on: ubuntu-latest | |
| needs: release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Deploy Sphinx documentation | |
| id: deployment | |
| uses: sphinx-notes/pages@v3 | |
| with: | |
| publish: false | |
| checkout: false | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| keep_files: true | |
| force_orphan: false | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ${{ steps.deployment.outputs.artifact }} | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' |