exclude oldest (pytorch) macos tests due to tokenizers build error #269
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PyPI | |
on: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
tags: | |
description: 'Test scenario tags' | |
required: false | |
type: boolean | |
push: | |
branches: [main, "release/*"] | |
release: | |
types: [published] | |
jobs: | |
build-package: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: >- | |
python -m pip install --user --upgrade build | |
- name: Build packages | |
run: | | |
python -m build | |
ls -lh dist/ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pypi-packages-${{ github.sha }} | |
path: dist | |
upload-package: | |
runs-on: ubuntu-22.04 | |
needs: build-package | |
# only upload package assets with new release | |
if: github.event_name == 'release' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: pypi-packages-${{ github.sha }} | |
path: dist | |
- run: ls -lh dist/ | |
- name: Upload to release | |
uses: AButler/[email protected] | |
with: | |
files: 'dist/*' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
publish-package-testpypi: | |
runs-on: ubuntu-22.04 | |
needs: build-package | |
permissions: | |
id-token: write | |
# only publish packages with new tags or release | |
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: pypi-packages-${{ github.sha }} | |
path: dist | |
- run: ls -lh dist/ | |
- name: Delay releasing | |
# give time to verify that the release looks good on github before proceeding with pypi | |
uses: juliangruber/sleep-action@v1 | |
with: | |
time: 3m | |
- name: Publish to Test PyPI | |
uses: pypa/[email protected] | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.test_pypi_password }} | |
# repository_url: https://test.pypi.org/legacy/ | |
# verbose: true | |
publish-package-pypi: | |
runs-on: ubuntu-22.04 | |
needs: publish-package-testpypi | |
permissions: | |
id-token: write | |
# only publish packages with new tags or release | |
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: pypi-packages-${{ github.sha }} | |
path: dist | |
- run: ls -lh dist/ | |
- name: Delay releasing | |
# give time to verify that the release looks good on github before proceeding with pypi | |
uses: juliangruber/sleep-action@v1 | |
with: | |
time: 2m | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/[email protected] | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.pypi_password }} |