feat: Update #47
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 (release → PyPI) | ||
| on: | ||
| push: | ||
| branches: | ||
| - release | ||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
| pull-requests: write | ||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi-universalpython | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build twine python-semantic-release | ||
| pip install -r utils/requirements.txt | ||
| - name: Create stable release | ||
| id: release | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| semantic-release version --commit --tag --push | ||
| - name: Build package | ||
| run: bash utils/build_package.sh | ||
| # - name: Publish to TestPyPI | ||
| # uses: pypa/gh-action-pypi-publish@release/v1 | ||
| # with: | ||
| # repository-url: https://test.pypi.org/legacy/ | ||
| # packages-dir: dist/ | ||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| packages-dir: dist/nc release → main | ||
| uses: peter-evans/create-pull-request@v5 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| base: main | ||
| head: release | ||
| title: "chore: merge release changes back into main" | ||
| body: | | ||
| This PR was created automatically after publishing a new PyPI release. | ||
| It keeps `main` in sync with version and changelog updates. | ||