Skip to content

Commit

Permalink
added publish to pypi (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
BolunDai0216 authored Aug 17, 2024
2 parents 753d672 + 6b0dd7d commit 43b60c5
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy Docs
on:
push:
branches: [main]
branches: [paused]

permissions:
contents: write
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: build-publish

on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]

jobs:
build-wheels:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install pypa/build
run: >-
python -m
pip install -U
build
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Store wheels
uses: actions/upload-artifact@v3
with:
path: dist

publish:
runs-on: ubuntu-latest
needs:
- build-wheels
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download dists
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 43b60c5

Please sign in to comment.