Merge pull request #54 from InternetNZ/develop #140
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: PyEPP | |
on: | |
push: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements.dev.txt | |
pip install setuptools==65.5.1 | |
pip install build twine | |
- name: Lint | |
run: | | |
./scripts/linter.sh | |
- name: Tests | |
run: | | |
./scripts/tests.sh | |
- name: Package Audit | |
run: | | |
./scripts/package-audit.sh | |
- name: Code Security Check | |
run: | | |
./scripts/code-security-check.sh | |
- name: Publish to TestPyPi | |
if: github.event_name == 'push' && github.ref == 'refs/heads/develop' | |
run: | | |
rm -rf dist | |
python -m build | |
twine check dist/* | |
twine upload -r testpypi --username __token__ --password ${{ secrets.TEST_PYPI_API_TOKEN }} dist/* | |
- name: Publish to PyPi | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: | | |
rm -rf dist | |
python -m build | |
twine check dist/* | |
twine upload --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} dist/* | |
- name: Cleanup workspace | |
uses: colpal/actions-clean@v1 | |
if: ${{ always() }} # To ensure this step runs even when earlier steps fail |