Feat/check-v2 common packages under open cepk #14
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: Publish Python 🐍 distributions 📦 to PyPI | |
on: | |
workflow_run: | |
workflows: ["pre-commit"] | |
types: | |
- completed | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
name: test the package build | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v5.1.0 | |
with: | |
python-version: 3.11 | |
- name: Run test-pre-commit-hook.sh for check version package | |
run: | | |
pip3 install . | |
pip3 install ".[dep]" | |
build-n-publish: | |
needs: build | |
name: Build and publish Python 🐍 distributions 📦 to PyPI | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v5.1.0 | |
with: | |
python-version: 3.11 | |
- name: Install pip packages | |
run: pip install twine build setuptools | |
- name: Build the package | |
run: python -m build | |
- name: Publish release distributions to PyPI | |
if: ${{ github.event_name == 'pull_request' && github.head_ref == '/refs/heads/main' && github.event.action == 'closed' && github.event.pull_request.merged == true }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true |