Skip to content

Commit

Permalink
ci: add github actions ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zyf722 committed Aug 17, 2024
1 parent 4cbe599 commit 6ce279b
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Poetry Build

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
strategy:
matrix:
python-version: [3.8, 3.9, 3.10, 3.11, 3.12]
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry

- name: Set Poetry environment
run: poetry env use ${{ matrix.python-version }}

- name: Install dependencies
run: poetry install

- name: Build package
run: poetry build
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Poetry Publish to PyPI

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
cache: poetry

- name: Set Poetry environment
run: |
poetry env use python
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
- name: Install dependencies
run: poetry install

- name: Publish to PyPI
run: poetry publish --build

0 comments on commit 6ce279b

Please sign in to comment.