-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (61 loc) · 1.82 KB
/
publish.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
name: Publish Python 🐍 distribution 📦 to PyPI
on:
release:
types: [created]
permissions:
id-token: write
jobs:
tests:
name: Linting and running tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start databases
working-directory: ./sample-apps/databases
run: docker compose up --build -d
- name: Add local.aikido.io to /etc/hosts
run: |
sudo echo "127.0.0.1 local.aikido.io" | sudo tee -a /etc/hosts
- name: Installation
run: make dev_install
- name: Run Pylint
run: |
poetry run pylint --fail-under=9 --rcfile=.pylintrc aikido_zen/
pylint_exit_code=$?
if [ $pylint_exit_code -ne 0 ]; then
echo "Pylint check failed. Please fix the issues."
exit 1
fi
- name: Run Black Check
run: |
poetry run black --check --diff aikido_zen/
black_exit_code=$?
if [ $black_exit_code -ne 0 ]; then
echo "Black check failed. Please run 'black .' to format the code."
exit 1
fi
- name: Run tests
run: |
make test
build:
name: Build distribution 📦 and Publish to PyPI
needs:
- tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pip install poetry
- name: Set the version for this release
run: |
TAG_NAME=${GITHUB_REF##*/}
make replace_version version=${TAG_NAME#v}
- name: Download binaries & build
run: make build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # release/v1
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/