Skip to content

Commit 8720bf2

Browse files
authored
Merge pull request #19 from jake1164/static-mpy-cross
Update to use pre compiled mpy-cross binaries
2 parents 65e44ca + 7966bf9 commit 8720bf2

File tree

4 files changed

+281
-269
lines changed

4 files changed

+281
-269
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# SPDX-FileCopyrightText: 2022 Alec Delaney, written for Adafruit Industries
2-
#
3-
# SPDX-License-Identifier: MIT
4-
5-
name: Build CI
6-
7-
on: [pull_request, push]
8-
9-
jobs:
10-
test:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Set up Python 3.x (Latest)
14-
uses: actions/setup-python@v4
15-
with:
16-
python-version: "3.x"
17-
- name: Checkout current repo
18-
uses: actions/checkout@v3
19-
with:
20-
submodules: true
21-
- name: Install pre-commit
22-
run: pip install pre-commit
23-
- name: Run pre-commit
24-
run: pre-commit run --all-files
1+
# SPDX-FileCopyrightText: 2022 Alec Delaney, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: Build CI
6+
7+
on: [pull_request, push]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Set up Python 3.x (Latest)
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.x"
17+
- name: Checkout current repo
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: true
21+
- name: Install pre-commit
22+
run: pip install pre-commit
23+
- name: Run pre-commit
24+
run: pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# SPDX-FileCopyrightText: 2022 Alec Delaney, written for Adafruit Industries
2-
#
3-
# SPDX-License-Identifier: MIT
4-
5-
repos:
6-
- repo: https://github.com/python/black
7-
rev: 23.3.0
8-
hooks:
9-
- id: black
10-
- repo: https://github.com/fsfe/reuse-tool
11-
rev: v1.1.2
12-
hooks:
13-
- id: reuse
14-
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v4.4.0
16-
hooks:
17-
- id: check-yaml
18-
- id: end-of-file-fixer
19-
- id: trailing-whitespace
1+
# SPDX-FileCopyrightText: 2022 Alec Delaney, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
repos:
6+
- repo: https://github.com/python/black
7+
rev: 25.1.0
8+
hooks:
9+
- id: black
10+
- repo: https://github.com/fsfe/reuse-tool
11+
rev: v3.0.2
12+
hooks:
13+
- id: reuse
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v6.0.0
16+
hooks:
17+
- id: check-yaml
18+
- id: end-of-file-fixer
19+
- id: trailing-whitespace

README.rst

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,32 @@ build-mpy
1010
=========
1111

1212
GitHub Action for building packages of ``.mpy`` files for CircuitPython projects and attaching them to releases
13-
as ZIP files. Files other than ``.mpy`` and ``.py`` files will be added to the ZIP file as well. Note that
14-
any files named or ``code.py`` are automatically not compiled for convenience.
13+
as ZIP files. Files other than ``.mpy`` and ``.py`` files will be added to the ZIP file as well. Note that
14+
``code.py`` and any files excluded via the `mpy-manifest-file` are not compiled.
1515

1616
Inputs
1717
======
1818

1919
======================= ===================================================================== ==================== =====================================================================
2020
Argument Name Description Default Notes
2121
======================= ===================================================================== ==================== =====================================================================
22-
github-token Your GitHub token N/A N/A
23-
circuitpy-tag The version of CircuitPython to compile for N/A You can use any valid tag (or branch) from ``adafruit/circuitpython``
22+
github-token Your GitHub token N/A (required) N/A
23+
circuitpy-version The version of CircuitPython to download and use N/A (required) You can specify any version from ``https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross``
2424
zip-filename The name of the ZIP file that will be attached "mpy-release.zip" N/A
25-
circuitpython-repo-name The name of the clone CircuitPython repo "circuitpython-repo" Change if it conflicts with another file
2625
mpy-directory The directory to search for files to compile "." (top folder) Becomes the basis for filepaths in ``mpy-manifest-file``
2726
mpy-manifest-file A file with a list of files to compile or exclude "" If none is given, all files in ``mpy-directory`` are used
2827
mpy-manifest-type Whether the files in the manifest file should be included or excluded "include" N/A
2928
zip-directory The directory to add to the ZIP file "." (top folder) Becomes the basis for filepaths in ``zip-manifest-file``
3029
zip-manifest-file A file with a list of files to add to the ZIP file or exclude from it "" If none is given, all files in ``zip-directory`` are used
3130
zip-manifest-type Whether the files in the manifest file should be included or excluded "include" N/A
31+
compiler-directory The directory where the CircuitPython compiler will be downloaded "circuitpy-compiler" N/A
3232
======================= ===================================================================== ==================== =====================================================================
3333

3434
Examples
3535
========
3636

3737
If you have just a repository with files intended for a CircuitPython board, your release
38-
file could be very simple! This release CI creates .mpy files for CircuitPython 8.2.0:
38+
file could be very simple!
3939

4040
.. code-block:: yaml
4141
@@ -48,19 +48,20 @@ file could be very simple! This release CI creates .mpy files for CircuitPython
4848
runs-on: ubuntu-latest
4949
steps:
5050
- name: Checkout the current repo
51-
uses: actions/checkout@v3
51+
uses: actions/checkout@v4
5252
with:
5353
submodules: true
5454
- name: Run MPY Action
55-
uses: adafruit/build-mpy@v1
55+
uses: adafruit/build-mpy@v2
5656
with:
5757
github-token: ${{ secrets.GITHUB_TOKEN }}
58-
circuitpy-tag: "8.2.0"
58+
circuitpy-version: "9.2.8"
5959
6060
You also have granular control of which directories to compile and zip and the ability to specify which
61-
files should or should not be compiled and/or zipped. For example, if you wanted to compile and zip
62-
files in a folder named ``microcontroller`` and you wanted to use a manifest file named ``mpy_manifest.txt``
63-
to specify certain files NOT to compile, you could modify the script above to be:
61+
files should or should not be compiled and/or zipped as well as the ability to specify a different CircuitPython version.
62+
For example, if you wanted to compile and zip files in a folder named ``microcontroller`` and you wanted to
63+
use a manifest file named ``mpy_manifest.txt`` to specify certain files NOT to compile, using CircuitPython
64+
version ``9.2.8``, you could modify the script above to be:
6465

6566
.. code-block:: yaml
6667
@@ -73,14 +74,14 @@ to specify certain files NOT to compile, you could modify the script above to be
7374
runs-on: ubuntu-latest
7475
steps:
7576
- name: Checkout the current repo
76-
uses: actions/checkout@v3
77+
uses: actions/checkout@v4
7778
with:
7879
submodules: true
7980
- name: Run MPY Action
80-
uses: adafruit/build-mpy@v1
81+
uses: adafruit/build-mpy@v2
8182
with:
8283
github-token: ${{ secrets.GITHUB_TOKEN }}
83-
circuitpy-tag: "8.2.0"
84+
circuitpy-version: "9.2.8"
8485
mpy-directory: "microcontroller"
8586
mpy-manifest-file: "mpy_manifest.txt"
8687
mpy-manifest-type: "exclude"

0 commit comments

Comments
 (0)