moved pip-build-test to release workflow #1
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
--- | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
publish: | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
timeout-minutes: 3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: Install python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements_build.txt >/dev/null | |
pip install -r requirements.txt >/dev/null | |
shell: bash | |
- name: Testing to build Ansible-WebUI with PIP | |
run: | | |
cd /tmp | |
echo 'CREATING TMP VENV' | |
tmp_venv="/tmp/ansible-webui-venv/$(date +%s)" | |
python3 -m virtualenv "$tmp_venv" >/dev/null | |
source "${tmp_venv}/bin/activate" | |
echo 'INSTALLING MODULE' | |
python3 -m pip install -e "$GITHUB_WORKSPACE" >/dev/null | |
set +e | |
echo 'RUNNING APP' | |
timeout 2 python3 -m ansible-webui | |
ec="$?" | |
echo 'CLEANUP' | |
deactivate | |
rm -rf "$tmp_venv" | |
if [[ "$ec" != "124" ]] | |
then | |
exit 1 | |
fi | |
shell: bash | |
- name: Extract tag name | |
id: version | |
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 2-) | |
- name: Building | |
run: | | |
echo "${{ steps.version.outputs.TAG_NAME }}" > VERSION | |
python3 -m build | |
shell: bash | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |