From c210e70edc56617f5b8afc2dd90736c696a4ed51 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Mon, 22 Jul 2024 08:13:02 +0200 Subject: [PATCH 1/2] chore: update pre-commit hooks versions --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0eb0b1b4..34836284 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -16,14 +16,14 @@ repos: - license_header.txt # defaults to: LICENSE.txt - --use-current-year - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.2.1' + rev: 'v0.5.4' hooks: - id: ruff args: ['--fix', '--preview'] - id: ruff-format args: ['--preview'] - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.8.0' + rev: 'v1.11.0' hooks: - id: mypy args: ['--warn-unused-ignores'] From 9ab8c68bbde82ffc3fcb8cbeaa29916639fd1b92 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Mon, 22 Jul 2024 10:03:51 +0200 Subject: [PATCH 2/2] feat: upload binary executable, users no need to install python --- .github/workflows/publish-bin.yml | 40 ++++++++++++++++++++++++++++++ .github/workflows/publish-pypi.yml | 2 +- .gitignore | 1 + 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish-bin.yml diff --git a/.github/workflows/publish-bin.yml b/.github/workflows/publish-bin.yml new file mode 100644 index 00000000..0e48d9d3 --- /dev/null +++ b/.github/workflows/publish-bin.yml @@ -0,0 +1,40 @@ +name: Publish Bin Executable + +on: + push: + tags: + - 'v*' + +jobs: + deploy-bin: + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - windows-latest +# - macos-latest + - macos-13 # for python 3.7 + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.7' + - name: Install dependencies + run: | + pip install pyinstaller + pip install . + - name: Build executable + shell: bash + run: | + echo -e "from idf_build_apps.main import main\nif __name__ == '__main__':\n main()\n" > idf-build-apps.py + export IDF_PATH=$(pwd) + export VERSION=$(pip list | grep idf-build-apps | awk '{print $2}') + export OS=$(echo ${{ matrix.os }} | sed 's/-.*//') + pyinstaller -F idf-build-apps.py -n "idf-build-apps-${OS}-${VERSION}" + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: idf-build-apps-${{ matrix.os }} + path: dist/* diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index eb024816..9e7bb68b 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -6,7 +6,7 @@ on: - 'v*' jobs: - deploy: + deploy-pypi: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index e7c499a1..c2b15591 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ MANIFEST # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec +idf-build-apps.py # Installer logs pip-log.txt