-
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.
Merge pull request #3 from yugokato/release_and_publish
Add GH workflow for publishing package to pypi
- Loading branch information
Showing
2 changed files
with
55 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,52 @@ | ||
name: release | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
build: | ||
name: Build package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build and Check Package | ||
uses: hynek/build-and-inspect-python-package@v2 | ||
|
||
publish-to-testpypi: | ||
name: Publish to TestPyPI | ||
needs: [ build ] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/project/pytest-smoke/ | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist/ | ||
- name: Publish package to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
publish-to-pypi: | ||
name: Publish to PyPI | ||
needs: [ publish-to-testpypi ] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/project/pytest-smoke/ | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist/ | ||
- name: Publish package to PyPI | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,7 @@ repos: | |
rev: v5.0.0 | ||
hooks: | ||
- id: check-toml | ||
- id: check-yaml | ||
args: | ||
- --unsafe | ||
- id: end-of-file-fixer |