-
Notifications
You must be signed in to change notification settings - Fork 182
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 #606 from geeksville/pr-poetry
Change build to use poetry
- Loading branch information
Showing
17 changed files
with
1,705 additions
and
213 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 |
---|---|---|
|
@@ -12,26 +12,36 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip3 install poetry | ||
- name: Bump version | ||
run: >- | ||
bin/bump_version.py | ||
poetry version patch | ||
- name: Commit updated version.py | ||
- name: Commit updated version. | ||
id: commit_updated | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email '[email protected]' | ||
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | ||
git add setup.py | ||
git add pyproject.toml | ||
git commit -m "bump version" && git push || echo "No changes to commit" | ||
git log -n 1 --pretty=format:"%H" | tail -n 1 | awk '{print "::set-output name=sha::"$0}' | ||
- name: Get version | ||
id: get_version | ||
run: >- | ||
bin/show_version.py | ||
poetry version | ||
- name: Create GitHub release | ||
uses: actions/create-release@v1 | ||
|
@@ -47,26 +57,9 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install pypa/build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: >- | ||
python -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ | ||
. | ||
poetry build | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
|
@@ -79,14 +72,14 @@ jobs: | |
# needs: release_create | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# ref: ${{ needs.release_create.outputs.new_sha }} | ||
|
||
# - name: Set up Python 3.9 | ||
# uses: actions/setup-python@v2 | ||
# uses: actions/setup-python@v5 | ||
# with: | ||
# python-version: 3.9 | ||
# python-version: "3.9" | ||
|
||
# - name: Setup code signing | ||
# env: | ||
|
@@ -125,21 +118,19 @@ jobs: | |
needs: release_create | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.release_create.outputs.new_sha }} | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.9 | ||
python-version: "3.9" | ||
|
||
- name: Build | ||
run: | | ||
pip install pyinstaller | ||
pip install -r requirements.txt | ||
pip install . | ||
pyinstaller -F -n meshtastic --collect-all meshtastic meshtastic/__main__.py | ||
pip install poetry | ||
bin/build-bin.sh | ||
- name: Add ubuntu to release | ||
uses: actions/upload-release-asset@v1 | ||
|
@@ -166,21 +157,19 @@ jobs: | |
needs: release_create | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.release_create.outputs.new_sha }} | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.9 | ||
python-version: "3.9" | ||
|
||
- name: Build | ||
run: | | ||
pip install pyinstaller | ||
pip install -r requirements.txt | ||
pip install . | ||
pyinstaller -F -n meshtastic --collect-all meshtastic meshtastic/__main__.py | ||
pip install poetry | ||
bin/build-bin.sh | ||
- name: Add windows to release | ||
uses: actions/upload-release-asset@v1 | ||
|
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 |
---|---|---|
|
@@ -16,3 +16,4 @@ __pycache__ | |
examples/__pycache__ | ||
meshtastic.spec | ||
.hypothesis/ | ||
coverage.xml |
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,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo Building ubuntu binary | ||
poetry install | ||
source $(poetry env info --path)/bin/activate | ||
pyinstaller -F -n meshtastic --collect-all meshtastic meshtastic/__main__.py | ||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# This script lets you run github ci actions locally | ||
# You need to have act installed. You can get it at https://nektosact.com/ | ||
|
||
# by default it simulates a push event | ||
# other useful options | ||
# -j build-and-publish-ubuntu | ||
|
||
# also: we only run one of the 4 matrix tests, because otherwise it absolutely hammers the CPU (so many containers and threads) | ||
act -P ubuntu-latest=-self-hosted --matrix "python-version:3.8" "$@" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
rm dist/* | ||
set -e | ||
|
||
python3 setup.py sdist bdist_wheel | ||
python3 -m twine upload dist/* | ||
poetry build | ||
poetry run pytest | ||
poetry publish | ||
#python3 setup.py sdist bdist_wheel | ||
#python3 -m twine upload dist/* |
Oops, something went wrong.