-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from brainelectronics/feature/use-enhanced-cicd
Use enhanced CICD
- Loading branch information
Showing
12 changed files
with
188 additions
and
283 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to | ||
# help make automated releases for this project | ||
|
||
name: Upload Python Package to test.pypi.org | ||
|
||
on: [pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.9' | ||
- name: Install build dependencies | ||
run: | | ||
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi | ||
- name: Build package | ||
run: | | ||
changelog2version \ | ||
--changelog_file changelog.md \ | ||
--version_file nextion/version.py \ | ||
--version_file_type py \ | ||
--additional_version_info="-rc${{ github.run_number }}.dev${{ github.event.number }}" \ | ||
--debug | ||
# micropython-nextion is owned by someone else on test.pypi.org | ||
# rename package only for this case | ||
sed -i \ | ||
"s/name\='micropython-nextion'/name\='be-micropython-nextion'/" \ | ||
setup.py | ||
python setup.py sdist | ||
- name: Test built package | ||
# sdist call creates non twine conform "*.orig" files, remove them | ||
run: | | ||
rm dist/*.orig | ||
twine check dist/*.tar.gz | ||
- name: Archive build package artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context | ||
# ${{ github.repository }} and ${{ github.ref_name }} can't be used for artifact name due to unallowed '/' | ||
name: dist_repo.${{ github.event.repository.name }}_sha.${{ github.sha }}_build.${{ github.run_number }} | ||
path: dist/*.tar.gz | ||
retention-days: 14 | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1.5 | ||
with: | ||
repository_url: https://test.pypi.org/legacy/ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
skip_existing: true | ||
verbose: true | ||
print_hash: true |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# MicroPython Nextion library | ||
|
||
[![Downloads](https://pepy.tech/badge/micropython-nextion)](https://pepy.tech/project/micropython-nextion) | ||
![Release](https://img.shields.io/github/v/release/brainelectronics/micropython-nextion?include_prereleases&color=success) | ||
![MicroPython](https://img.shields.io/badge/micropython-Ok-green.svg) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) | ||
|
||
MicroPython Nextion library | ||
|
||
--------------- | ||
|
||
## Get started | ||
|
||
This is a quickstart guide to flash the | ||
[MicroPython firmware][ref-upy-firmware-download], connect to a network and | ||
install the MicroPython Nextion library on the board | ||
|
||
### Flash firmware | ||
|
||
```bash | ||
esptool.py --chip esp32 --port /dev/tty.SLAB_USBtoUART erase_flash | ||
esptool.py --chip esp32 --port /dev/tty.SLAB_USBtoUART --baud 921600 write_flash -z 0x1000 esp32spiram-20220117-v1.18.bin | ||
``` | ||
|
||
### Install package on board with pip | ||
|
||
```bash | ||
rshell -p /dev/tty.SLAB_USBtoUART --editor nano | ||
``` | ||
|
||
Inside the rshell | ||
|
||
```bash | ||
cp examples/progressbar/main.py /pyboard | ||
cp examples/boot.py /pyboard | ||
repl | ||
``` | ||
|
||
Inside the REPL | ||
|
||
```python | ||
import machine | ||
import network | ||
import time | ||
import upip | ||
|
||
station = network.WLAN(network.STA_IF) | ||
station.active(True) | ||
station.connect('SSID', 'PASSWORD') | ||
time.sleep(1) | ||
print('Device connected to network: {}'.format(station.isconnected())) | ||
|
||
upip.install('micropython-nextion') | ||
|
||
print('Installation completed') | ||
machine.soft_reset() | ||
``` | ||
|
||
<!-- Links --> | ||
[ref-upy-firmware-download]: https://micropython.org/download/ |
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
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
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
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
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
Oops, something went wrong.