Update iconsdk-workflow.yml #1
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: unittest and publish to pypi | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
release: | |
types: [published] | |
jobs: | |
unittest: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
- name: Install dependency | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e .[tests] | |
- name: Run Test | |
run: | | |
python -m pytest -ra | |
deploy: | |
needs: unittest | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.7" | |
cache: pip | |
- name: Install dependency | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
echo "::notice:: pip list" | |
pip list | |
- name: Build package | |
id: build_package | |
run: | | |
python setup.py sdist bdist_wheel | |
echo "::notice:: ls -al dist" | |
ls -al dist | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 |