chore: add missing permission to release workflow #3
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 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| id-token: write | |
| checks: write | |
| jobs: | |
| unittests: | |
| uses: ./.github/workflows/run-unittests.yml | |
| with: | |
| python-versions: '["3.9", "3.10", "3.11", "3.12"]' | |
| release: | |
| needs: unittests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install pipenv and dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pipenv | |
| pipenv install --dev | |
| - name: Auto bump version | |
| id: bump | |
| run: | | |
| python scripts/bump_version.py | |
| VERSION=$(grep '__version__' src/codius/version.py | cut -d'"' -f2) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Commit and push version bump | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| git add src/codius/version.py | |
| git commit -m "chore(release): bump version to ${{ steps.bump.outputs.version }}" | |
| git push | |
| - name: Build package | |
| run: pipenv run python -m build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v${{ steps.bump.outputs.version }} | |
| name: Release v${{ steps.bump.outputs.version }} | |
| generate_release_notes: true |