-
-
Notifications
You must be signed in to change notification settings - Fork 7
74 lines (60 loc) · 1.74 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
name: Release on PyPI
on:
push:
tags:
- '*'
jobs:
publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
timeout-minutes: 3
defaults:
run:
shell: bash
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
# NOTE: timeout for running the app includes db migrations
- name: Testing to build Ansible-WebUI with PIP
run: |
cd /tmp
echo 'CREATING TMP VENV'
tmp_venv="/tmp/aw-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'
export AW_DB="/tmp/$(date +%s).aw.db"
timeout 20 python3 -m ansibleguy-webui
ec="$?"
echo 'CLEANUP'
deactivate
rm -rf "$tmp_venv"
if [[ "$ec" != "124" ]]
then
exit 1
fi
- name: Extract tag name
id: version
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 1-)
- name: Building
run: |
echo "${{ steps.version.outputs.TAG_NAME }}" > VERSION
python3 -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}