-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
176 additions
and
0 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,65 @@ | ||
# -- WORKFLOW: Publish/release this package on PyPI | ||
# SEE: | ||
# * https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
# * https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-python#publishing-to-pypi | ||
# | ||
# * https://docs.github.com/en/actions/writing-workflows | ||
# * https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs | ||
# * https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#release | ||
# | ||
# GITHUB ACTIONS: | ||
# * https://github.com/actions/checkout | ||
# * https://github.com/pypa/gh-action-pypi-publish | ||
# | ||
# RELATED: | ||
# * https://github.com/actions/starter-workflows/blob/main/ci/python-publish.yml | ||
|
||
# -- STATE: PREPARED_ONLY, NOT_RELEASED_YET | ||
name: manual-release-to-pypi | ||
on: | ||
workflow_dispatch: # -- NOTE: Run it manually and provide the version. | ||
inputs: | ||
VERSION: | ||
description: "Existing version to publish the release (to pypi; EXAMPLE: VERSION=1.2.7)" | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
publish-package: | ||
runs-on: ubuntu-latest | ||
# MAYBE: if: github.event_name == "push" && startsWith(github.ref, "refs/tags/v") | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/project/parse-type | ||
# OR: https://pypi.org/p/<YOURPROJECT> | ||
permissions: | ||
id-token: write # REQUIRED-FOR: Trusted publishing. | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: "v${{inputs.VERSION}}" | ||
# env: | ||
# VERSION: "${{inputs.VERSION}}" | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: "Install Python package dependencies (with: uv)" | ||
run: | | ||
python -m pip install -U uv | ||
python -m uv pip install -U pip setuptools wheel build twine | ||
- name: Build this package | ||
run: python -m build | ||
- name: Check this package (before upload) | ||
run: twine check dist/* ─╯ | ||
- name: Upload this package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
print-hash: true | ||
verbose: true | ||
# -- MAYBE: | ||
# with: | ||
# repository-url: https://test.pypi.org/legacy/ | ||
# password: ${{ secrets.TEST_PYPI_API_TOKEN }} |
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,53 @@ | ||
# -- WORKFLOW: Publish/release this package on PyPI | ||
# SEE: | ||
# * https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
# * https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-python#publishing-to-pypi | ||
# | ||
# * https://docs.github.com/en/actions/writing-workflows | ||
# * https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs | ||
# * https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#release | ||
# | ||
# GITHUB ACTIONS: | ||
# * https://github.com/actions/checkout | ||
# * https://github.com/pypa/gh-action-pypi-publish | ||
# | ||
# RELATED: | ||
# * https://github.com/actions/starter-workflows/blob/main/ci/python-publish.yml | ||
|
||
# -- STATE: PREPARED_ONLY, NOT_RELEASED_YET | ||
name: release-to-pypi | ||
on: | ||
release: | ||
types: [published] | ||
# MAYBE: if: github.event_name == "push" && startsWith(github.ref, "refs/tags/v") | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
publish-package: | ||
runs-on: ubuntu-latest | ||
# MAYBE: if: github.event_name == "push" && startsWith(github.ref, "refs/tags/v") | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/parse-type | ||
permissions: | ||
id-token: write # REQUIRED-FOR: Trusted publishing. | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: "Install Python package dependencies (with: uv)" | ||
run: | | ||
python -m pip install -U uv | ||
python -m uv pip install -U pip setuptools wheel build twine | ||
- name: Build this package | ||
run: python -m build | ||
- name: Check this package (before upload) | ||
run: twine check dist/* ─╯ | ||
- name: Upload this package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
print-hash: true | ||
verbose: true |
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,58 @@ | ||
# -- WORKFLOW: Publish/release this package on PyPI (testpypi) | ||
# SEE: | ||
# * https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
# * https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-python#publishing-to-pypi | ||
# | ||
# * https://docs.github.com/en/actions/writing-workflows | ||
# * https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs | ||
# * https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#release | ||
# | ||
# GITHUB ACTIONS: | ||
# * https://github.com/actions/checkout | ||
# * https://github.com/pypa/gh-action-pypi-publish | ||
# | ||
# RELATED: | ||
# * https://github.com/actions/starter-workflows/blob/main/ci/python-publish.yml | ||
|
||
# -- STATE: PREPARED_ONLY, NOT_RELEASED_YET | ||
name: release-to-pypi | ||
on: | ||
release: | ||
types: [published] | ||
# MAYBE: if: github.event_name == "push" && startsWith(github.ref, "refs/tags/v") | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
publish-package: | ||
runs-on: ubuntu-latest | ||
# MAYBE: if: github.event_name == "push" && startsWith(github.ref, "refs/tags/v") | ||
environment: | ||
name: pypi | ||
url: https://test.pypi.org/project/parse-type | ||
# OR: https://test.pypi.org/p/<YOURPROJECT> | ||
permissions: | ||
id-token: write # REQUIRED-FOR: Trusted publishing. | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: "Install Python package dependencies (with: uv)" | ||
run: | | ||
python -m pip install -U uv | ||
python -m uv pip install -U pip setuptools wheel build twine | ||
- name: Build this package | ||
run: python -m build | ||
- name: Check this package (before upload) | ||
run: twine check dist/* ─╯ | ||
- name: Upload this package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
print-hash: true | ||
verbose: true | ||
# -- MAYBE: | ||
# with: | ||
# repository-url: https://test.pypi.org/legacy/ | ||
# password: ${{ secrets.TEST_PYPI_API_TOKEN }} |