pypi workflow
This commit is contained in:
parent
8929306c64
commit
a05fb9f5fb
2 changed files with 49 additions and 4 deletions
8
.github/workflows/package.yaml
vendored
8
.github/workflows/package.yaml
vendored
|
|
@ -20,7 +20,7 @@ jobs:
|
|||
# Push image to GitHub Packages.
|
||||
# See also https://docs.docker.com/docker-hub/builds/
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [ "3.10" ]
|
||||
|
|
@ -49,7 +49,7 @@ jobs:
|
|||
|
||||
# Build ARM64 container, only on master branch to save time testing
|
||||
package-arm64:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [
|
||||
build
|
||||
]
|
||||
|
|
@ -93,7 +93,7 @@ jobs:
|
|||
|
||||
# Build AMD64 container
|
||||
package-amd64:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [
|
||||
build
|
||||
]
|
||||
|
|
@ -137,7 +137,7 @@ jobs:
|
|||
# On master branch, build the docker manifest file from the cached
|
||||
# docker builds and push to the registry
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [
|
||||
build,
|
||||
package-arm64,
|
||||
|
|
|
|||
45
.github/workflows/pypi.yaml
vendored
Normal file
45
.github/workflows/pypi.yaml
vendored
Normal 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 }}
|
||||
Loading…
Reference in a new issue