chore: add ci workflows

This commit is contained in:
Daylin Morgan 2024-03-08 12:58:40 -06:00
parent 2aa643ad79
commit 107389dd98
Signed by: daylin
GPG key ID: 950D13E9719334AD
2 changed files with 70 additions and 0 deletions

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

@ -0,0 +1,33 @@
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
environment:
name: pypi
url: https://pypi.org/p/swydd
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
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 package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

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

@ -0,0 +1,37 @@
name: 🚀 Release
on:
push:
tags:
- 'v*.*'
permissions:
contents: write
jobs:
run-tests:
uses: ./.github/workflows/test.yml
build-n-publish:
needs: run-tests
permissions:
id-token: write
uses: ./.github/workflows/pypi.yml
create-release:
needs: build-n-publish
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate New Release
run: gh release create ${{ github.ref }}