Skip to content

Commit 4203553

Browse files
geeksvillegithub-actions
authored andcommitted
changes to (hopefully) make release CI actions work
add pyinstaller as a dev dep. Use it to make "bin/build-bin.sh" remove old version scripts (no longer needed with poetry)
1 parent 9e319f3 commit 4203553

7 files changed

Lines changed: 150 additions & 83 deletions

File tree

.github/workflows/release.yml

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,34 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v4
1616

17+
- name: Set up Python 3.9
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.9"
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip3 install poetry
26+
1727
- name: Bump version
1828
run: >-
19-
bin/bump_version.py
29+
poetry version patch
2030
21-
- name: Commit updated version.py
31+
- name: Commit updated version.
2232
id: commit_updated
2333
run: |
2434
git config --global user.name 'github-actions'
2535
git config --global user.email 'bot@noreply.github.com'
2636
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
27-
git add setup.py
37+
git add pyproject.toml
2838
git commit -m "bump version" && git push || echo "No changes to commit"
2939
git log -n 1 --pretty=format:"%H" | tail -n 1 | awk '{print "::set-output name=sha::"$0}'
3040
3141
- name: Get version
3242
id: get_version
3343
run: >-
34-
bin/show_version.py
44+
poetry version
3545
3646
- name: Create GitHub release
3747
uses: actions/create-release@v1
@@ -47,26 +57,9 @@ jobs:
4757
env:
4858
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4959

50-
- name: Set up Python 3.9
51-
uses: actions/setup-python@v5
52-
with:
53-
python-version: "3.9"
54-
55-
- name: Install pypa/build
56-
run: >-
57-
python -m
58-
pip install
59-
build
60-
--user
61-
6260
- name: Build a binary wheel and a source tarball
6361
run: >-
64-
python -m
65-
build
66-
--sdist
67-
--wheel
68-
--outdir dist/
69-
.
62+
poetry build
7063
7164
- name: Publish to PyPI
7265
uses: pypa/gh-action-pypi-publish@master
@@ -136,10 +129,8 @@ jobs:
136129

137130
- name: Build
138131
run: |
139-
pip install pyinstaller
140-
pip install -r requirements.txt
141-
pip install .
142-
pyinstaller -F -n meshtastic --collect-all meshtastic meshtastic/__main__.py
132+
pip install poetry
133+
bin/build-bin.sh
143134
144135
- name: Add ubuntu to release
145136
uses: actions/upload-release-asset@v1
@@ -177,10 +168,8 @@ jobs:
177168

178169
- name: Build
179170
run: |
180-
pip install pyinstaller
181-
pip install -r requirements.txt
182-
pip install .
183-
pyinstaller -F -n meshtastic --collect-all meshtastic meshtastic/__main__.py
171+
pip install poetry
172+
bin/build-bin.sh
184173
185174
- name: Add windows to release
186175
uses: actions/upload-release-asset@v1

bin/build-bin.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
echo Building ubuntu binary
6+
poetry install
7+
source $(poetry env info --path)/bin/activate
8+
pyinstaller -F -n meshtastic --collect-all meshtastic meshtastic/__main__.py
9+

bin/bump_version.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

bin/run-ci-local.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/bash
22

33
# This script lets you run github ci actions locally
4+
# You need to have act installed. You can get it at https://nektosact.com/
5+
6+
# by default it simulates a push event
7+
# other useful options
8+
# -j build-and-publish-ubuntu
49

510
# also: we only run one of the 4 matrix tests, because otherwise it absolutely hammers the CPU (so many containers and threads)
6-
act -P ubuntu-latest=-self-hosted --matrix "python-version:3.8"
11+
act -P ubuntu-latest=-self-hosted --matrix "python-version:3.8" "$@"

bin/show_version.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

poetry.lock

Lines changed: 114 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "meshtastic"
3-
version = "2.3.7"
3+
version = "2.3.11"
44
description = "Python API & client shell for talking to Meshtastic devices"
55
authors = ["Meshtastic Developers <contact@meshtastic.org>"]
66
license = "GPL-3.0-only"
@@ -38,6 +38,7 @@ pdoc3 = "^0.10.0"
3838
autopep8 = "^2.1.0"
3939
pylint = "^3.2.3"
4040
pytap2 = "^2.3.0"
41+
pyinstaller = "^6.8.0"
4142

4243
[tool.poetry.extras]
4344
tunnel = ["pytap2"]

0 commit comments

Comments
 (0)