-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'test-cd' into stable-tagging
- Loading branch information
Showing
5 changed files
with
62 additions
and
68 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -8,28 +8,74 @@ concurrency: | |
group: tests-${{ 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/[email protected] | ||
|
||
create-release: | ||
name: >- | ||
Create a release on GitHub's UI | ||
which triggers the actual 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 | ||
if: >- | ||
github.event.pull_request.merged == true | ||
&& contains(github.event.pull_request.labels.*.name, 'release-version') | ||
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##bump changelog for }" >> "$GITHUB_ENV" | ||
echo "version=${TITLE/: [[:alnum:]]*} }" >> "$GITHUB_OUTPUT" | ||
- name: Create release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
generateReleaseNotes: true | ||
tag: "${{ env.VERSION }}" | ||
commit: ${{ github.event.pull_request.merge_commit_sha }} | ||
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 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 |
---|---|---|
|
@@ -85,42 +85,3 @@ jobs: | |
name: pipx.pyz | ||
path: pipx.pyz | ||
retention-days: 3 | ||
|
||
pypi-publish: | ||
name: Publish pipx to PyPI on release | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
needs: [tests, man, zipapp] | ||
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/[email protected] | ||
|
||
upload-zipapp: | ||
name: Upload zipapp to GitHub Release on release | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
needs: [tests, man, zipapp] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: pipx.pyz | ||
- name: Upload to release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: pipx.pyz |
This file contains 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 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