diff --git a/.github/workflows/bump-changelog.yml b/.github/workflows/bump-changelog.yml index 0d7331eaed..050e942505 100644 --- a/.github/workflows/bump-changelog.yml +++ b/.github/workflows/bump-changelog.yml @@ -41,7 +41,11 @@ jobs: run: | git config --global user.name 'github-actions[bot]' git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' +<<<<<<< HEAD git commit -am "Bump changelog for $RELEASE_VERSION" +======= + git commit -am "$RELEASE_VERSION: Bump changelog" +>>>>>>> test-cd git fetch origin git push origin $PR_BRANCH - name: Create pull request diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c5695f8b4..6e9e003238 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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/gh-action-pypi-publish@v1.8.14 + 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 }} \ No newline at end of file + 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 }}" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edfef56a4f..71450e74c8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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/gh-action-pypi-publish@v1.8.14 - - 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 84eca5be77..d1bff2feb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,20 +11,9 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t ## [1.5.0](https://github.com/pypa/pipx/tree/1.5.0) - 2024-03-29 - ### Features -<<<<<<< HEAD - Add `--global` option to `pipx` commands. - - This will run the action in a global scope and affect environment for all system users. ([#754](https://github.com/pypa/pipx/issues/754)) -- Add a `--fetch-missing-python` flag to all commands that accept a `--python` flag. - - When combined, this will automatically download a standalone copy of the requested python version if it's not already available on the user's system. ([#1242](https://github.com/pypa/pipx/issues/1242)) -- Add commands to list and prune standalone interpreters ([#1248](https://github.com/pypa/pipx/issues/1248)) -- Revert platform-specific directories on MacOS and Windows - - They were leading to a lot of issues with Windows sandboxing and spaces in shebangs on MacOS. ([#1257](https://github.com/pypa/pipx/issues/1257)) -- Add `--install` option to `pipx upgrade` command. - - This will install the package given as argument if it is not already installed. ([#1262](https://github.com/pypa/pipx/issues/1262)) -======= - Add a `--fetch-missing-python` flag to all commands that accept a `--python` flag. When combined, this will automatically download a standalone copy of the requested python version if it's not already available on the user's system. ([#1242](https://github.com/pypa/pipx/issues/1242)) @@ -32,15 +21,11 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t - Add `--install` option to `pipx upgrade` command. This will install the package given as argument if it is not already installed. ([#1262](https://github.com/pypa/pipx/issues/1262)) ->>>>>>> Bump changelog for 1.0.0 (#2) ### Bugfixes - Correctly resolve home directory in pipx directory environment variables. ([#94](https://github.com/pypa/pipx/issues/94)) -<<<<<<< HEAD - Pass through `pip` arguments when upgrading shared libraries. ([#964](https://github.com/pypa/pipx/issues/964)) -======= ->>>>>>> Bump changelog for 1.0.0 (#2) - Fix installation issues when files in the working directory interfere with venv creation process. ([#1091](https://github.com/pypa/pipx/issues/1091)) - Report correct filename in tracebacks with `pipx run ` ([#1191](https://github.com/pypa/pipx/issues/1191)) - Let self-managed pipx uninstall itself on windows again. ([#1203](https://github.com/pypa/pipx/issues/1203)) @@ -54,7 +39,6 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t - Update the example for running scripts with dependencies. ([#1227](https://github.com/pypa/pipx/issues/1227)) - Update the docs for package developers on the use of configuration using pyproject.toml ([#1229](https://github.com/pypa/pipx/issues/1229)) - Add installation instructions for Fedora ([#1239](https://github.com/pypa/pipx/issues/1239)) -<<<<<<< HEAD - Update the examples for installation from local dir ([#1277](https://github.com/pypa/pipx/issues/1277)) - Fix inconsistent wording in `pipx install` command description. ([#1307](https://github.com/pypa/pipx/issues/1307)) @@ -65,8 +49,6 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t ### Misc - [#1296](https://github.com/pypa/pipx/issues/1296) -======= ->>>>>>> Bump changelog for 1.0.0 (#2) ## [1.4.3](https://github.com/pypa/pipx/tree/1.4.3) - 2024-01-16 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b94854bace..d5984fd73a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -221,10 +221,11 @@ nox -s watch_docs ## Releasing New `pipx` Versions To release a new version, manually run the `bump-changelog` action under the *"Actions"* tab, passing it the version to -be released. Then, simply create a "published" release on GitHub. This will trigger GitHub workflows that publish: +be released. This will trigger GitHub workflows that publish: - the pipx version to PyPI, -- the documentation to readthedocs, +- the documentation to ReadTheDocs, +- a GitHub release - the `zipapp` to the GitHub release created. No need for any other pre or post publish steps.