Skip to content

Commit

Permalink
Create create-release job in tests.yml:x
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysle committed Apr 9, 2024
1 parent 3f62f1f commit 2ab684e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/bump-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ jobs:
- name: Create pull request
run: |
git fetch origin
gh pr create --base main --fill
gh pr create --base main --fill --label release-version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,31 @@ jobs:
path: pipx.pyz
retention-days: 3

create-release:
name: >-
Create a release on GitHub's UI
which triggers the actual release
runs-on: ubuntu-latest
permissions:
contents: write
if: >-
github.event_name == 'pull_request'
&& github.event.pull_request.merged == true
&& github.event.pull_request.labels.name == 'release-version'
steps:
- uses: actions/checkout@v4
- name: Extract version to be released
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV"
- name: Create release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
tag: "$VERSION"
commit: ${{ github.event.pull_request.merge_commit_sha }}

pypi-publish:
name: Publish pipx to PyPI on release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
Expand Down

0 comments on commit 2ab684e

Please sign in to comment.