forked from CleanCut/green
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will allow us to release to pypi directly from the GH UI by simply creating a tagged release. Addresses CleanCut#278
- Loading branch information
Showing
6 changed files
with
86 additions
and
27 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Keep the content of this file in sync with release.yml. | ||
|
||
name: Release Test | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
pypi-publish: | ||
name: Upload release to PyPI | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/green | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12.2 | ||
|
||
- name: Install | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade '.[dev]' | ||
- name: Test | ||
run: green -rv green | ||
|
||
- name: Build | ||
run: make sdist | ||
|
||
- name: Publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Keep the content of this file in sync with release-test.yml. | ||
|
||
name: Release | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
pypi-publish: | ||
name: Upload release to PyPI | ||
if: github.event_name == 'release' | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/green | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12.2 | ||
|
||
- name: Install | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade '.[dev]' | ||
- name: Test | ||
run: green -rv green | ||
|
||
- name: Build | ||
run: make sdist | ||
|
||
- name: Publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.0.1-dev | ||
4.0.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,10 @@ | ||
Steps to Release | ||
================ | ||
|
||
1. Bump the version in `green/VERSION` | ||
1. Bump the version in `green/VERSION`, per [PEP 440](https://peps.python.org/pep-0440/). | ||
|
||
2. Run `make release` | ||
2. Push and merge to the main branch. | ||
|
||
3. Trigger the Release Test workflow in GitHub Actions. Optional but recommended. | ||
|
||
Very First Time | ||
=============== | ||
|
||
1. Set up `~/.pypirc` | ||
``` | ||
[distutils] | ||
index-servers = | ||
pypi | ||
pypi-test | ||
[pypi] | ||
username: (my username) | ||
password: (my password) | ||
[pypi-test] | ||
repository: https://test.pypi.org/legacy/ | ||
username: (my username) | ||
password: (my password) | ||
``` | ||
|
||
2. `python setup.py register -r pypi` | ||
4. Create a new release in GitHub with a tag that mirrors the version, the GH action will take care of the rest. |