Skip to content

Commit

Permalink
Merge pull request #3 from yugokato/release_and_publish
Browse files Browse the repository at this point in the history
Add GH workflow for publishing package to pypi
  • Loading branch information
yugokato authored Nov 7, 2024
2 parents 540ec79 + b049d07 commit 199a8c4
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
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
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ repos:
rev: v5.0.0
hooks:
- id: check-toml
- id: check-yaml
args:
- --unsafe
- id: end-of-file-fixer

0 comments on commit 199a8c4

Please sign in to comment.