-
Notifications
You must be signed in to change notification settings - Fork 6
38 lines (32 loc) · 1.11 KB
/
release_pypi.yml
File metadata and controls
38 lines (32 loc) · 1.11 KB
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
name: PyPI release
on:
release:
types: [released]
jobs:
build_and_upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@master
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip build setuptools twine
- name: Build and upload esp-idf-kconfig
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PROJECT_TOKEN }}
run: |
pip install .
PUBLISHED_VERSION=$(curl https://pypi.org/pypi/esp-idf-kconfig/json 2>/dev/null | jq -r '.info.version')
CURRENT_VERSION=$(python -c "from esp_idf_kconfig import __version__; print(__version__)")
if [ "$PUBLISHED_VERSION" == "$CURRENT_VERSION" ]; then
echo "Version ${PUBLISHED_VERSION} already published, skipping..."
exit 0
else
echo "Packaging and publishing new esp-idf-kconfig version: ${CURRENT_VERSION}"
python -m build
twine check dist/* && twine upload dist/*
fi