-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull version from VCS to simplify release and build dynamic docs via …
…mkdocs plugin (#1130) Co-authored-by: Jason Lam <[email protected]>
- Loading branch information
1 parent
28ffb99
commit 9639e2c
Showing
16 changed files
with
242 additions
and
512 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
schedule: | ||
|
@@ -41,12 +42,26 @@ jobs: | |
- name: Install nox | ||
run: python -m pip install nox | ||
- name: Execute Tests | ||
run: nox --non-interactive --session tests-${{ matrix.python-version }} | ||
run: nox --error-on-missing-interpreters --non-interactive --session tests-${{ matrix.python-version }} | ||
man: | ||
name: Build man page | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ env.default-python }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.default-python }} | ||
cache: "pip" | ||
- name: Install nox | ||
run: python -m pip install nox | ||
- name: Build man page | ||
run: nox --error-on-missing-interpreters --non-interactive --session build_man | ||
- name: Show man page | ||
run: man -l pipx.1 | ||
|
||
pypi-publish: | ||
name: Publish pipx to PyPI on release | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
needs: [tests] | ||
zipapp: | ||
name: Build zipapp | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout ${{ github.ref }} | ||
|
@@ -58,19 +73,26 @@ jobs: | |
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] | ||
- name: Build zipapp | ||
run: nox --error-on-missing-interpreters --non-interactive --session zipapp | ||
- name: Test zipapp by installing black | ||
run: python ./pipx.pyz install black | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
name: pipx.pyz | ||
path: pipx.pyz | ||
retention-days: 3 | ||
|
||
build-zipapp: | ||
name: Build zipapp | ||
pypi-publish: | ||
name: Publish pipx to PyPI on release | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
needs: [tests] | ||
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 | ||
|
@@ -79,15 +101,44 @@ jobs: | |
with: | ||
python-version: ${{ env.default-python }} | ||
cache: "pip" | ||
- name: Install shiv | ||
run: pip install shiv | ||
- name: Build zipapp | ||
run: shiv -c pipx -o ./pipx.pyz git+https://github.com/pypa/pipx@${{ github.ref_name }} | ||
- name: Show zipapp version | ||
run: python ./pipx.pyz --version | ||
- name: Test zipapp by installing black | ||
run: python ./pipx.pyz install black | ||
- name: Upload to releases | ||
- 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@v3 | ||
with: | ||
name: pipx.pyz | ||
- name: Upload to release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: pipx.pyz | ||
|
||
bump-changelog: | ||
name: Bump changelog on release | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
needs: [pypi-publish, upload-zipapp] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout ${{ github.ref }} | ||
uses: actions/checkout@v4 | ||
- name: Extract release tag | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Update changelog | ||
run: echo -e "## dev\n\n## $RELEASE_VERSION\n$(tail -n +2 CHANGELOG.md)" > CHANGELOG.md | ||
- name: Commit and push change | ||
run: | | ||
git config --global user.name 'Github Actions' | ||
git config --global user.email '[email protected]' | ||
git commit -am "Bump changelog for $RELEASE_VERSION" | ||
git push |
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 |
---|---|---|
@@ -1,22 +1,17 @@ | ||
/.nox/ | ||
/.coverage | ||
*egg* | ||
.mypy_cache | ||
.vscode | ||
build | ||
dist | ||
activate | ||
__pypackages__ | ||
venv | ||
.venv | ||
.DS_Store | ||
.tox | ||
/.*_cache | ||
/build | ||
/dist | ||
/src/pipx/version.py | ||
/noxfile.py | ||
/.nox | ||
*.py[co] | ||
__pycache__ | ||
site | ||
docs/docs.md | ||
pipx.1 | ||
.pipx_tests | ||
/site | ||
/.coverage* | ||
/testdata | ||
!/testdata/empty_project | ||
/.idea | ||
/.pipx_tests | ||
/testdata/tests_packages/*.txt | ||
/pipx.pyz | ||
*.egg-info | ||
build | ||
*.whl | ||
/pipx.1 |
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
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
Oops, something went wrong.