Skip to content

Commit

Permalink
CI add publish to pypi (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongjiajie authored Jun 18, 2024
1 parent a1c6a1d commit 0c587cb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: CI

on:
push:
branches:
- main
tags:
- "**"
pull_request:

concurrency:
Expand Down Expand Up @@ -41,5 +41,20 @@ jobs:
env:
FYMAIL_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
hatch env create test
hatch env create fymail-test
hatch test
publish:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
needs: test
steps:
- uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install
- name: publish
env:
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.PYPI_API_TOKEN }}
run: |
hatch build
hatch publish
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Source = "https://github.com/zhongjiajie/fymail"
[tool.hatch.version]
path = "src/fymail/__init__.py"

[tool.hatch.envs.test]
[tool.hatch.envs.fymail-test]
extra-dependencies = [
"pytest-asyncio",
]
Expand All @@ -68,6 +68,9 @@ preview = true
[tool.ruff.lint.extend-per-file-ignores]
"examples/*" = ["INP001"]

[tool.ruff.lint.isort]
known-first-party = ["fymail"]

[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
Expand Down

0 comments on commit 0c587cb

Please sign in to comment.