Skip to content

Commit

Permalink
Create pypi.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Cheong authored May 27, 2023
1 parent 73a0142 commit 97ee57f
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Upload Python Package

on:
release:
types: [published]
push:
branches: [main]
pull_request:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
ci:
if: github.event_name != 'release'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.11"]
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: make
- name: Build CI
run: make build
- name: Syntax CI
run: make ci

deploy:
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11.0'
- name: Install dependencies
run: make
- name: Build package
run: make build
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.8.5
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 97ee57f

Please sign in to comment.