ci: add release and build jobs

This commit is contained in:
Daylin Morgan 2023-08-21 15:48:40 -05:00
parent 478c8da422
commit e26922b808
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F
3 changed files with 60 additions and 1 deletions

View file

@ -5,6 +5,7 @@ on:
tags: [ "v*.*" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04

29
.github/workflows/pypi.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: Build and Publish to PyPI
on:
workflow_call:
workflow_dispatch:
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install pypa/build
run: >-
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: >-
python -m build --sdist --wheel --outdir dist/ .
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

29
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: 🚀 Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
build-n-publish:
uses: ./.github/workflows/pypi.yml
create-release:
env:
GH_TOKEN: ${{ github.token }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: update latest tag
uses: richardsimko/update-tag@v1
with:
tag_name: latest
- name: Generate New Release
run: |
gh release create ${{ github.ref }}