pypi workflow

This commit is contained in:
Jesse Bannon 2023-02-20 15:58:47 -08:00
parent 8929306c64
commit a05fb9f5fb
2 changed files with 49 additions and 4 deletions

View file

@ -20,7 +20,7 @@ jobs:
# Push image to GitHub Packages. # Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/ # See also https://docs.docker.com/docker-hub/builds/
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
python-version: [ "3.10" ] python-version: [ "3.10" ]
@ -49,7 +49,7 @@ jobs:
# Build ARM64 container, only on master branch to save time testing # Build ARM64 container, only on master branch to save time testing
package-arm64: package-arm64:
runs-on: ubuntu-latest runs-on: ubuntu-22.04
needs: [ needs: [
build build
] ]
@ -93,7 +93,7 @@ jobs:
# Build AMD64 container # Build AMD64 container
package-amd64: package-amd64:
runs-on: ubuntu-latest runs-on: ubuntu-22.04
needs: [ needs: [
build build
] ]
@ -137,7 +137,7 @@ jobs:
# On master branch, build the docker manifest file from the cached # On master branch, build the docker manifest file from the cached
# docker builds and push to the registry # docker builds and push to the registry
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-22.04
needs: [ needs: [
build, build,
package-arm64, package-arm64,

45
.github/workflows/pypi.yaml vendored Normal file
View file

@ -0,0 +1,45 @@
name: ytld-sub PyPI Push
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for any PRs.
pull_request:
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [ "3.10" ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Build Wheel
run: |
make wheel
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}