v0.0.20 #117
Workflow file for this run
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: build package wheel | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
detect-changes: | |
uses: ./.github/workflows/check_diff.yml | |
with: | |
file_path: pyproject.toml | |
build: | |
needs: detect-changes | |
if: needs.detect-changes.outputs.version_changed == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" # Use the latest version of Python 3 | |
- name: Install Flit | |
run: python -m pip install flit | |
- name: Build Wheel with Flit | |
run: flit build | |
- name: Test Install Wheel | |
run: pip install dist/*.whl | |
- name: Upload to GitHub Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: python-package | |
path: dist/*.whl | |
publish-to-pypi: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.detect-changes.outputs.only_patch_version_changed == 'true' | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" # Use the latest version of Python 3 | |
- name: Install Twine | |
run: python -m pip install --upgrade pip && python -m pip install --upgrade twine | |
- name: Install Flit | |
run: python -m pip install flit | |
- name: Build Wheel with Flit | |
run: flit build | |
- name: Upload to PyPI using script | |
run: bash scripts/upload_latest.sh | |
env: | |
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} |