-
Notifications
You must be signed in to change notification settings - Fork 559
Refactor release process in order to include changelog in release files #1246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
b5ed112
Extract `bump-changelog` action into separate workflow
chrysle 17247a3
Create `create-release` job in `tests.yml`
chrysle 3fbaa57
Bump changelog for 1.0.0 (#2)
github-actions[bot] 24d0428
Specify pull request types that trigger CI
chrysle bcb9e15
Remove requirement for job
chrysle 0b7329f
Try to fix label detection
chrysle 789fd08
Try out `pull_request_target` event
chrysle 4784691
Fix environment variable access syntax
chrysle b8a6d3d
Try splitting out in separate workflow
chrysle 7162ae2
Use concurrency
chrysle 4618518
Create `create-release` job in `tests.yml`
chrysle 88b5679
Specify pull request types that trigger CI
chrysle 5b8f71d
Remove requirement for job
chrysle 72c7d6c
Try to fix label detection
chrysle 8af9b56
Try out `pull_request_target` event
chrysle 33c7255
Fix environment variable access syntax
chrysle b116c2b
Try moving related jobs into release workflow
chrysle 5ec28b6
Specify Python version in release workflow
chrysle bbc1bec
Amend for testing
chrysle 1c97b0c
Retrieve artifact from previous workflow run
chrysle f590cb0
Create release before uploading asset (makes sense)
chrysle abe0228
Specify tag name
chrysle bb56f99
Don't run in parallel *yawn*
chrysle 63dfd8a
Get that blasted tag
chrysle e5c9c94
Permissions
chrysle 09f0ac0
Cleanup, docs
chrysle 22c7ef0
Extract `bump-changelog` action into separate workflow
chrysle cb3bc70
Create `create-release` job in `tests.yml`
chrysle ecc2a13
Bump changelog for 1.0.0 (#2)
github-actions[bot] 0acecbb
Specify pull request types that trigger CI
chrysle aa3b1e1
Remove requirement for job
chrysle ef1c9d2
Try to fix label detection
chrysle 6d2f27e
Try out `pull_request_target` event
chrysle fc40ed4
Fix environment variable access syntax
chrysle eb9bee1
Try splitting out in separate workflow
chrysle 35fb55d
Use concurrency
chrysle dc124f5
Create `create-release` job in `tests.yml`
chrysle 74e9383
Specify pull request types that trigger CI
chrysle 92a26b2
Remove requirement for job
chrysle 7795882
Try to fix label detection
chrysle 5e3e23e
Try out `pull_request_target` event
chrysle 2118c32
Fix environment variable access syntax
chrysle fdf8055
Try moving related jobs into release workflow
chrysle 8401019
Specify Python version in release workflow
chrysle 5d006fb
Amend for testing
chrysle 5b5bf24
Retrieve artifact from previous workflow run
chrysle 5572513
Create release before uploading asset (makes sense)
chrysle 14c9526
Specify tag name
chrysle fe1dba9
Don't run in parallel *yawn*
chrysle 02baf8b
Get that blasted tag
chrysle a880669
Permissions
chrysle a48b1fc
Cleanup, docs
chrysle aee2f52
Better sentence structure
chrysle 4338952
Merge branch 'stable-tagging' of github.com:chrysle/pipx into stable-…
chrysle 99bc753
Use concurrency in `bump-changelog.yml`
chrysle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: Bump changelog before release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Version to be released' | ||
| required: true | ||
| type: string | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| default-python: "3.12" | ||
| minimum-supported-python: "3.8" | ||
|
|
||
| jobs: | ||
| bump-changelog: | ||
| name: Bump changelog | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| - name: Checkout ${{ github.ref }} | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ env.default-python }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ env.default-python }} | ||
| cache: "pip" | ||
| - name: Get release version and construct PR branch | ||
| run: | | ||
| echo "RELEASE_VERSION=${{ inputs.version }}" >> $GITHUB_ENV | ||
| echo "PR_BRANCH=bump-changelog-for-${{ inputs.version }}" >> $GITHUB_ENV | ||
| - name: Create pull request branch | ||
| run: git switch -c $PR_BRANCH | ||
| - name: Install nox | ||
| run: python -m pip install nox | ||
| - name: Update changelog | ||
| run: nox --error-on-missing-interpreters --non-interactive --session build_changelog -- $RELEASE_VERSION | ||
| - name: Commit and push change | ||
| run: | | ||
| git config --global user.name 'github-actions[bot]' | ||
| git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
| git commit -am "$RELEASE_VERSION: Bump changelog" | ||
| git fetch origin | ||
| git push origin $PR_BRANCH | ||
| - name: Create pull request | ||
| run: | | ||
| git fetch origin | ||
| gh pr create --base main --fill --label release-version | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: | ||
| - closed | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| default-python: "3.12" | ||
|
|
||
| jobs: | ||
| pypi-publish: | ||
| name: Publish pipx to PyPI | ||
| if: >- | ||
| github.event.pull_request.merged == true | ||
| && contains(github.event.pull_request.labels.*.name, 'release-version') | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: release | ||
| url: https://pypi.org/p/pipx | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - name: Checkout ${{ github.ref }} | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ env.default-python }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ env.default-python }} | ||
| cache: "pip" | ||
| - name: Install nox | ||
| run: pip install nox | ||
| - name: Build sdist and wheel | ||
| run: nox --error-on-missing-interpreters --non-interactive --session build | ||
| - name: Publish to PyPi | ||
| uses: pypa/gh-action-pypi-publish@v1.8.14 | ||
|
|
||
| create-release: | ||
| name: Create a release on GitHub's UI | ||
| needs: pypi-publish | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| release-tag: ${{ steps.get-version.outputs.version }} | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Extract version to be released | ||
| id: get-version | ||
| env: | ||
| TITLE: ${{ github.event.pull_request.title }} | ||
| run: | | ||
| echo "version=${TITLE/: [[:alnum:]]*} }" >> "$GITHUB_OUTPUT" | ||
| - name: Create release | ||
| uses: ncipollo/release-action@v1 | ||
| with: | ||
| generateReleaseNotes: true | ||
| tag: "${{ steps.get-version.outputs.version }}" | ||
| commit: ${{ github.event.pull_request.merge_commit_sha }} | ||
|
|
||
| upload-zipapp: | ||
| name: Upload zipapp to GitHub Release | ||
| needs: create-release | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: dawidd6/action-download-artifact@v3 | ||
| with: | ||
| name: pipx.pyz | ||
| workflow: tests.yml | ||
| workflow_conclusion: success | ||
| pr: ${{ github.event.pull_request.number }} | ||
| - name: Upload to release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| files: pipx.pyz | ||
| tag_name: "${{ needs.create-release.outputs.release-tag }}" |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.