Skip to content

CI add publish to pypi #9

CI add publish to pypi

CI add publish to pypi #9

Workflow file for this run

name: CI
on:
push:
tags:
- "**"
pull_request:
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install
- name: Run Lint
run: |
hatch fmt --check
build:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install
- name: Run Build
run: |
hatch env create
hatch build
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install
- name: Run Test
env:
FYMAIL_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
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