diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index f0e92b36..cfb3984d 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -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, diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml new file mode 100644 index 00000000..0cbee7cc --- /dev/null +++ b/.github/workflows/pypi.yaml @@ -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 }} \ No newline at end of file