-
Notifications
You must be signed in to change notification settings - Fork 1.4k
40 lines (32 loc) · 1.19 KB
/
dev_release_esptool_pypi.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
# This workflow will upload an esptool Python package when a dev release tag (e.g. "v4.7.dev2") is pushed
name: PyPI dev release
on:
push:
tags:
- v*.*.dev*
jobs:
build_and_upload:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') && contains(github.ref_name, 'dev')
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
python -m pip install twine build
- name: Create development release ${{ github.ref_name }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_NON_INTERACTIVE: true
run: |
python ci/patch_dev_release.py --version ${{ github.ref_name }} esptool/__init__.py
git diff
python -m pip download esptool==$(python setup.py -V) && echo "Version ${{ github.ref_name }} already published, skipping..." && exit 1
echo "Packaging and publishing new esptool development release: ${{ github.ref_name }}"
python -m build --sdist
twine upload dist/*