-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pushes to main now trigger a release on PyPi. Also added a workflow f…
…or manually releasing on TestPyPi.
- Loading branch information
1 parent
b22d824
commit 0381b97
Showing
2 changed files
with
76 additions
and
6 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Build and release on TestPyPi | ||
on: | ||
workflow_dispatch: # Manual trigger (dev) | ||
jobs: | ||
checks_and_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Installing Poetry globally | ||
run: pipx install poetry | ||
- name: Installing Python | ||
id: setup-python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: /home/runner/.cache/pypoetry/virtualenvs | ||
key: poetry-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }} | ||
restore-keys: | | ||
poetry-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }} | ||
poetry-${{ steps.setup-python.outputs.python-version }}- | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y \ | ||
dpkg-dev \ | ||
build-essential \ | ||
freeglut3-dev \ | ||
libgl1-mesa-dev \ | ||
libglu1-mesa-dev \ | ||
libgstreamer-plugins-base1.0-dev \ | ||
libgtk-3-dev \ | ||
libjpeg-dev \ | ||
libnotify-dev \ | ||
libpng-dev \ | ||
libsdl2-dev \ | ||
libsm-dev \ | ||
libunwind-dev \ | ||
libtiff-dev \ | ||
libwebkit2gtk-4.0-dev \ | ||
libxtst-dev \ | ||
libgtk2.0-dev | ||
- name: Installing Poetry environment | ||
run: poetry install | ||
- name: Running pytest | ||
id: pytest | ||
run: poetry run pytest -v | ||
- name: Running mypy | ||
id: mypy | ||
run: poetry run mypy libretro_finder/ config/ tests/ | ||
- name: Running pylint | ||
id: pylint | ||
run: poetry run pylint libretro_finder/ config/ tests/ --fail-under=8 | ||
- name: Checking code coverage | ||
id: coverage | ||
run: poetry run pytest --cov=config --cov=libretro_finder --cov-fail-under=75 | ||
|
||
- name: Build source and .whl archives with Poetry | ||
id: build | ||
run: poetry build | ||
if: steps.pytest.outcome == 'success' && steps.mypy.outcome == 'success' && steps.pylint.outcome == 'success' && steps.coverage.outcome == 'success' | ||
|
||
- name: Authorize GitHub Actions to publish on PYPI | ||
run: | | ||
poetry config repositories.test-pypi https://test.pypi.org/legacy/ | ||
poetry config pypi-token.test-pypi ${{ secrets.TESTPYPI_API_TOKEN }} | ||
if: steps.build.outcome == 'success' | ||
- name: Publish on PYPI | ||
run: poetry publish -r test-pypi | ||
if: steps.build.outcome == 'success' |