Skip to content

Commit

Permalink
add build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbe7a committed May 23, 2024
1 parent 3dd58d5 commit 22f4bc7
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build
on:
push:
branches: [main]
pull_request:
permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install Python build
run: pip install build
- name: Build project
run: python -m build
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: artifact
path: dist/*

release:
name: Publish package
if: github.event_name == 'push' && github.ref_name == 'main'
needs: [build]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
environment: pypi
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Publish package on TestPyPi
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
with:
repository-url: https://test.pypi.org/legacy/
- name: Publish package on PyPi
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
- uses: actions/checkout@v4

0 comments on commit 22f4bc7

Please sign in to comment.