mirror of
https://github.com/meshtastic/python.git
synced 2026-01-02 21:07:55 -05:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e91015f5c8 | ||
|
|
d9c3edfb12 | ||
|
|
cbf9696f47 | ||
|
|
24e556b9a7 | ||
|
|
eaf29512b6 | ||
|
|
0c1e0ec375 | ||
|
|
33ff4e36de | ||
|
|
bf879934e6 | ||
|
|
b878fa3a80 | ||
|
|
901849f176 | ||
|
|
371c0d22c2 |
97
.github/workflows/release.yml
vendored
97
.github/workflows/release.yml
vendored
@@ -1,66 +1,79 @@
|
|||||||
name: Make Release
|
name: Make Release
|
||||||
on:
|
on: workflow_dispatch
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: "Release version (Example: 1.0.0, must match 'version' in setup.py)"
|
|
||||||
required: true
|
|
||||||
default: '1.0.0'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release_create:
|
release_create:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.get_version.outputs.version }}
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Bump version
|
||||||
|
run: >-
|
||||||
|
bin/bump_version.py
|
||||||
|
|
||||||
|
- name: Commit updated version.py
|
||||||
|
run: |
|
||||||
|
git config --global user.name 'github-actions'
|
||||||
|
git config --global user.email 'bot@noreply.github.com'
|
||||||
|
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
||||||
|
git add setup.py
|
||||||
|
git commit -m "bump version" && git push || echo "No changes to commit"
|
||||||
|
|
||||||
|
- name: Get version
|
||||||
|
id: get_version
|
||||||
|
run: >-
|
||||||
|
bin/show_version.py
|
||||||
|
|
||||||
- name: Create GitHub release
|
- name: Create GitHub release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
id: create_release
|
id: create_release
|
||||||
|
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
release_name: ${{ github.event.inputs.version}}
|
release_name: Meshtastic ${{ steps.get_version.outputs.version }}
|
||||||
tag_name: ${{ github.event.inputs.version}}
|
tag_name: ${{ steps.get_version.outputs.version }}
|
||||||
body: |
|
body: |
|
||||||
Autogenerated by github action, developer should edit as required before publishing...
|
Autogenerated by github action, developer should edit as required before publishing...
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
outputs:
|
- name: Checkout
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
publish_to_pypi:
|
- name: Set up Python 3.9
|
||||||
runs-on: ubuntu-latest
|
uses: actions/setup-python@v2
|
||||||
steps:
|
with:
|
||||||
- name: Checkout
|
python-version: 3.9
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Set up Python 3.9
|
- name: Install pypa/build
|
||||||
uses: actions/setup-python@v2
|
run: >-
|
||||||
with:
|
python -m
|
||||||
python-version: 3.9
|
pip install
|
||||||
|
build
|
||||||
|
--user
|
||||||
|
|
||||||
- name: Install pypa/build
|
- name: Build a binary wheel and a source tarball
|
||||||
run: >-
|
run: >-
|
||||||
python -m
|
python -m
|
||||||
pip install
|
build
|
||||||
build
|
--sdist
|
||||||
--user
|
--wheel
|
||||||
|
--outdir dist/
|
||||||
|
.
|
||||||
|
|
||||||
- name: Build a binary wheel and a source tarball
|
- name: Publish to PyPI
|
||||||
run: >-
|
uses: pypa/gh-action-pypi-publish@master
|
||||||
python -m
|
with:
|
||||||
build
|
user: __token__
|
||||||
--sdist
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
--wheel
|
|
||||||
--outdir dist/
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Publish to PyPI
|
|
||||||
uses: pypa/gh-action-pypi-publish@master
|
|
||||||
with:
|
|
||||||
user: __token__
|
|
||||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
||||||
|
|
||||||
|
|
||||||
build-and-publish-mac:
|
build-and-publish-mac:
|
||||||
@@ -137,7 +150,7 @@ jobs:
|
|||||||
asset_path: dist/meshtastic
|
asset_path: dist/meshtastic
|
||||||
asset_name: meshtastic_ubuntu
|
asset_name: meshtastic_ubuntu
|
||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
|
|
||||||
- name: Add readme.txt to release
|
- name: Add readme.txt to release
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
@@ -146,7 +159,7 @@ jobs:
|
|||||||
upload_url: ${{ needs.release_create.outputs.upload_url }}
|
upload_url: ${{ needs.release_create.outputs.upload_url }}
|
||||||
asset_path: standalone_readme.txt
|
asset_path: standalone_readme.txt
|
||||||
asset_name: readme.txt
|
asset_name: readme.txt
|
||||||
asset_content_type: text/plain
|
asset_content_type: text/plain
|
||||||
|
|
||||||
build-and-publish-windows:
|
build-and-publish-windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|||||||
25
bin/bump_version.py
Executable file
25
bin/bump_version.py
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
"""Bump the version number"""
|
||||||
|
|
||||||
|
version_filename = "setup.py"
|
||||||
|
|
||||||
|
lines = None
|
||||||
|
|
||||||
|
with open(version_filename, 'r', encoding='utf-8') as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
|
||||||
|
with open(version_filename, 'w', encoding='utf-8') as f:
|
||||||
|
for line in lines:
|
||||||
|
if line.lstrip().startswith("version="):
|
||||||
|
# get rid of quotes around the version
|
||||||
|
line = line.replace('"', '')
|
||||||
|
# get rid of trailing comma
|
||||||
|
line = line.replace(",", "")
|
||||||
|
# split on '='
|
||||||
|
words = line.split("=")
|
||||||
|
# split the version into parts (by period)
|
||||||
|
v = words[1].split(".")
|
||||||
|
ver = f'{v[0]}.{v[1]}.{int(v[2]) + 1}'
|
||||||
|
f.write(f' version="{ver}",\n')
|
||||||
|
else:
|
||||||
|
f.write(line)
|
||||||
20
bin/show_version.py
Executable file
20
bin/show_version.py
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
"""Show the version number"""
|
||||||
|
|
||||||
|
version_filename = "setup.py"
|
||||||
|
|
||||||
|
lines = None
|
||||||
|
|
||||||
|
with open(version_filename, 'r', encoding='utf-8') as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
|
||||||
|
for line in lines:
|
||||||
|
if line.lstrip().startswith("version="):
|
||||||
|
# get rid of quotes around the version
|
||||||
|
line2 = line.replace('"', '')
|
||||||
|
# get rid of the trailing comma
|
||||||
|
line2 = line2.replace(',', '')
|
||||||
|
# split on =
|
||||||
|
words = line2.split("=")
|
||||||
|
# Note: This format is for github actions
|
||||||
|
print(f'::set-output name=version::{words[1].strip()}')
|
||||||
2
proto
2
proto
Submodule proto updated: 6a66f8b1f8...30e147a55c
2
setup.py
2
setup.py
@@ -12,7 +12,7 @@ with open("README.md", "r") as fh:
|
|||||||
# This call to setup() does all the work
|
# This call to setup() does all the work
|
||||||
setup(
|
setup(
|
||||||
name="meshtastic",
|
name="meshtastic",
|
||||||
version="1.2.85",
|
version="1.2.86",
|
||||||
description="Python API & client shell for talking to Meshtastic devices",
|
description="Python API & client shell for talking to Meshtastic devices",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ readme.txt for single standalone executable zip files that can be
|
|||||||
downloaded from https://github.com/meshtastic/Meshtastic-python/releases
|
downloaded from https://github.com/meshtastic/Meshtastic-python/releases
|
||||||
|
|
||||||
If you do not want to install python and/or the python libraries, you can download one of these
|
If you do not want to install python and/or the python libraries, you can download one of these
|
||||||
zip files to run the Meshtastic command line interface (CLI) as a standalone executable.
|
files to run the Meshtastic command line interface (CLI) as a standalone executable.
|
||||||
|
|
||||||
See https://meshtastic.org/docs/software/python/python-standalone for more info.
|
See https://meshtastic.org/docs/software/python/python-standalone for more info.
|
||||||
|
|||||||
Reference in New Issue
Block a user