From 6141d3bffdd4ac213847b7b4cc884ca3897fb58f Mon Sep 17 00:00:00 2001 From: Jason Jackson Date: Sat, 21 Dec 2024 08:15:58 -0500 Subject: [PATCH 1/9] Update action.yml Changed from fetch-submodules to fetch-all-submodules. The error message "No rule to make target 'fetch-submodules'. Stop." might be resolved by using the correct make targets. Here are some relevant findings from the adafruit/circuitpython repository: Makefile Targets: fetch-translate-submodules: Fetches submodules for translation. fetch-all-submodules: Fetches submodules for all ports. Relevant Issues: Issue #9301: Discusses issues with submodule fetching in CI actions. Issue #9552: Details on setup documentation and fetching submodules for the Espressif build environment. Issue #8027: Provides information on issues related to building with submodules. To resolve the issue, you can try running: make fetch-all-submodules For more details on related issues, you can view the full list of discussions here. --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 6d3d2b8..c9b5812 100644 --- a/action.yml +++ b/action.yml @@ -87,7 +87,7 @@ runs: cd ${{ inputs.circuitpython-repo-name }} git fetch git checkout ${{ inputs.circuitpy-tag }} - make fetch-submodules + make fetch-all-submodules - name: Build mpy-cross shell: bash run: | From 9fe31ba6de02acdbd587af0a9b31274ccd7217a6 Mon Sep 17 00:00:00 2001 From: Jason Jackson Date: Fri, 14 Feb 2025 07:32:39 -0500 Subject: [PATCH 2/9] Switched to downloading mpy-cross --- action.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 5af6751..3ce0ea4 100644 --- a/action.yml +++ b/action.yml @@ -82,6 +82,7 @@ runs: repository: adafruit/circuitpython path: ${{ inputs.circuitpython-repo-name }} - name: Enter CircuitPython repo, checkout tag, and update + if: ${{ false }} shell: bash run: | function version() { @@ -96,17 +97,18 @@ runs: else make fetch-submodules fi - - name: Build mpy-cross + - name: Download mpy-cross shell: bash run: | - cd ${{ inputs.circuitpython-repo-name }}/mpy-cross - make clean - make + mkdir mpy-cross + cd mpy-cross + wget -O mpy-cross https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross/mpy-cross.static-amd64-linux-8.0.5 + chmod +x mpy-cross - name: Compile MPY files shell: bash run: | # Store repo name - reponame="${{ inputs.circuitpython-repo-name }}" + # reponame="${{ inputs.circuitpython-repo-name }}" # Read MPY manifest file contents, if needed if [[ "${{ inputs.mpy-manifest-file }}" != "" ]] @@ -136,7 +138,7 @@ runs: mpyresults+=("$outputmpy") prempyfile="${{ inputs.mpy-directory }}/$file" prempyfiles+=("$prempyfile") - ${reponame}/mpy-cross/mpy-cross $prempyfile -o $outputmpy + mpy-cross/mpy-cross $prempyfile -o $outputmpy fi done From e8c43c0b17d300831af2a86aafd709f4849d7257 Mon Sep 17 00:00:00 2001 From: Jason Jackson Date: Fri, 14 Feb 2025 08:01:50 -0500 Subject: [PATCH 3/9] Switched to specify the mpy-cross version and updated readme --- README.rst | 23 +++++++++++------------ action.yml | 38 ++++---------------------------------- 2 files changed, 15 insertions(+), 46 deletions(-) diff --git a/README.rst b/README.rst index fd83e8d..bc34b76 100644 --- a/README.rst +++ b/README.rst @@ -20,9 +20,8 @@ Inputs Argument Name Description Default Notes ======================= ===================================================================== ==================== ===================================================================== github-token Your GitHub token N/A N/A -circuitpy-tag The version of CircuitPython to compile for N/A You can use any valid tag (or branch) from ``adafruit/circuitpython`` +mpy-cross-version The version of mpy-cross to download and use 8.0.5 You can specify any version from ``https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross`` zip-filename The name of the ZIP file that will be attached "mpy-release.zip" N/A -circuitpython-repo-name The name of the clone CircuitPython repo "circuitpython-repo" Change if it conflicts with another file mpy-directory The directory to search for files to compile "." (top folder) Becomes the basis for filepaths in ``mpy-manifest-file`` 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 mpy-manifest-type Whether the files in the manifest file should be included or excluded "include" N/A @@ -35,7 +34,7 @@ Examples ======== If you have just a repository with files intended for a CircuitPython board, your release -file could be very simple! This release CI creates .mpy files for CircuitPython 8.2.0: +file could be very simple! .. code-block:: yaml @@ -48,19 +47,19 @@ file could be very simple! This release CI creates .mpy files for CircuitPython runs-on: ubuntu-latest steps: - name: Checkout the current repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Run MPY Action - uses: adafruit/build-mpy@v1 + uses: adafruit/build-mpy@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} - circuitpy-tag: "8.2.0" You also have granular control of which directories to compile and zip and the ability to specify which -files should or should not be compiled and/or zipped. For example, if you wanted to compile and zip -files in a folder named ``microcontroller`` and you wanted to use a manifest file named ``mpy_manifest.txt`` -to specify certain files NOT to compile, you could modify the script above to be: +files should or should not be compiled and/or zipped as well as the ability to specify a different mpy-cross +For example, if you wanted to compile and zip files in a folder named ``microcontroller`` and you wanted to +use a manifest file named ``mpy_manifest.txt`` to specify certain files NOT to compile, using mpy-cross +version ``7.3.1``, you could modify the script above to be: .. code-block:: yaml @@ -73,14 +72,14 @@ to specify certain files NOT to compile, you could modify the script above to be runs-on: ubuntu-latest steps: - name: Checkout the current repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Run MPY Action - uses: adafruit/build-mpy@v1 + uses: adafruit/build-mpy@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} - circuitpy-tag: "8.2.0" + mpy-cross-version: "7.3.1" mpy-directory: "microcontroller" mpy-manifest-file: "mpy_manifest.txt" mpy-manifest-type: "exclude" diff --git a/action.yml b/action.yml index 3ce0ea4..c31a38c 100644 --- a/action.yml +++ b/action.yml @@ -8,20 +8,14 @@ inputs: github-token: description: 'Your GitHub token, needed to upload the ZIP file' required: true - circuitpy-tag: - description: 'The CircuitPython version of mpy-cross to build' + mpy-cross-version: + description: 'The version of mpy-cross to use' required: true + default: "8.0.5" zip-filename: description: 'The name of the ZIP file to attach' required: true default: "mpy-release.zip" - circuitpython-repo-name: - description: > - The name for the CircuitPython repo. The default is 'circuitpython-repo', - and there typically isn't any reason to change this unless it conflicts - with an existing folder name in your repository. - required: true - default: 'circuitpython-repo' mpy-directory: description: > The directory to look for files to compile with mpy-cross. If none @@ -76,40 +70,16 @@ runs: sudo apt install build-essential sudo add-apt-repository ppa:pybricks/ppa sudo apt install git gettext uncrustify - - name: Clone adafruit/circuitpython - uses: actions/checkout@v3 - with: - repository: adafruit/circuitpython - path: ${{ inputs.circuitpython-repo-name }} - - name: Enter CircuitPython repo, checkout tag, and update - if: ${{ false }} - shell: bash - run: | - function version() { - echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; - } - cd ${{ inputs.circuitpython-repo-name }} - git fetch - git checkout ${{ inputs.circuitpy-tag }} - - if [ $(version "${{ inputs.circuitpy-tag }}") -ge $(version "8.2.0") ]; then - make fetch-all-submodules - else - make fetch-submodules - fi - name: Download mpy-cross shell: bash run: | mkdir mpy-cross cd mpy-cross - wget -O mpy-cross https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross/mpy-cross.static-amd64-linux-8.0.5 + wget -O mpy-cross https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ inputs.mpy-cross-version }} chmod +x mpy-cross - name: Compile MPY files shell: bash run: | - # Store repo name - # reponame="${{ inputs.circuitpython-repo-name }}" - # Read MPY manifest file contents, if needed if [[ "${{ inputs.mpy-manifest-file }}" != "" ]] then From 05212451d87d5d5afb45745d707d7f9124ec5379 Mon Sep 17 00:00:00 2001 From: Jason Jackson Date: Fri, 14 Feb 2025 08:09:34 -0500 Subject: [PATCH 4/9] Removed circuitpython reference --- action.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/action.yml b/action.yml index c31a38c..3fec7a1 100644 --- a/action.yml +++ b/action.yml @@ -96,7 +96,7 @@ runs: # Compile MPY files mpyresults=() prempyfiles=() - pyfiles=$(find ${{ inputs.mpy-directory }} -name "*.py" ! -path "./${{ inputs.circuitpython-repo-name }}/*" ! -name "code.py" -printf '%P\n') + pyfiles=$(find ${{ inputs.mpy-directory }} -name "*.py" ! -name "code.py" -printf '%P\n') for file in ${pyfiles[@]} do if [[ "${{ inputs.mpy-manifest-file }}" == "" ]] || \ @@ -112,10 +112,6 @@ runs: fi done - # Delete the CircuitPython repo - echo "Deleting CircuitPython repository folder" - rm -r ${{ inputs.circuitpython-repo-name }} - # Read ZIP manifest file contents, if needed if [[ "${{ inputs.zip-manifest-file }}" != "" ]] then From f83786655d616ed5dad1f744f0994b2f3f6d6709 Mon Sep 17 00:00:00 2001 From: Jason Jackson Date: Fri, 14 Feb 2025 08:13:29 -0500 Subject: [PATCH 5/9] Print out the mpy-cross version used --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 3fec7a1..68f9d34 100644 --- a/action.yml +++ b/action.yml @@ -80,6 +80,7 @@ runs: - name: Compile MPY files shell: bash run: | + echo "Compiling using mpy-cross version ${{ inputs.mpy-cross-version }}" # Read MPY manifest file contents, if needed if [[ "${{ inputs.mpy-manifest-file }}" != "" ]] then From 2548cf9b1c429d74e0ab9f1865cf4c81caa048ac Mon Sep 17 00:00:00 2001 From: Jason Jackson Date: Fri, 14 Feb 2025 09:50:22 -0500 Subject: [PATCH 6/9] removed trailing spaces from readme? --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index bc34b76..ba0dcbf 100644 --- a/README.rst +++ b/README.rst @@ -34,7 +34,7 @@ Examples ======== If you have just a repository with files intended for a CircuitPython board, your release -file could be very simple! +file could be very simple! .. code-block:: yaml @@ -57,8 +57,8 @@ file could be very simple! You also have granular control of which directories to compile and zip and the ability to specify which files should or should not be compiled and/or zipped as well as the ability to specify a different mpy-cross -For example, if you wanted to compile and zip files in a folder named ``microcontroller`` and you wanted to -use a manifest file named ``mpy_manifest.txt`` to specify certain files NOT to compile, using mpy-cross +For example, if you wanted to compile and zip files in a folder named ``microcontroller`` and you wanted to +use a manifest file named ``mpy_manifest.txt`` to specify certain files NOT to compile, using mpy-cross version ``7.3.1``, you could modify the script above to be: .. code-block:: yaml From 1bcbd802ccabb274af8102acabe5185d48268748 Mon Sep 17 00:00:00 2001 From: Jake1164 Date: Tue, 18 Feb 2025 09:22:34 -0500 Subject: [PATCH 7/9] Switched to OS subfolder and new naming --- README.rst | 2 +- action.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index ba0dcbf..89d395a 100644 --- a/README.rst +++ b/README.rst @@ -20,7 +20,7 @@ Inputs Argument Name Description Default Notes ======================= ===================================================================== ==================== ===================================================================== github-token Your GitHub token N/A N/A -mpy-cross-version The version of mpy-cross to download and use 8.0.5 You can specify any version from ``https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross`` +mpy-cross-version The version of mpy-cross to download and use 8.0.5 You can specify any version from ``https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross/linux-amd64`` zip-filename The name of the ZIP file that will be attached "mpy-release.zip" N/A mpy-directory The directory to search for files to compile "." (top folder) Becomes the basis for filepaths in ``mpy-manifest-file`` 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 diff --git a/action.yml b/action.yml index 68f9d34..0e0cc72 100644 --- a/action.yml +++ b/action.yml @@ -11,7 +11,7 @@ inputs: mpy-cross-version: description: 'The version of mpy-cross to use' required: true - default: "8.0.5" + default: "8.2.4" zip-filename: description: 'The name of the ZIP file to attach' required: true @@ -75,7 +75,7 @@ runs: run: | mkdir mpy-cross cd mpy-cross - wget -O mpy-cross https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ inputs.mpy-cross-version }} + wget -O mpy-cross https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross/linux-amd64/mpy-cross-linux-amd64-{{ inputs.mpy-cross-version }}.static chmod +x mpy-cross - name: Compile MPY files shell: bash From bc58353548dc26fe6aba78dbde4d83c89820a9a4 Mon Sep 17 00:00:00 2001 From: Jake1164 Date: Tue, 18 Feb 2025 09:33:18 -0500 Subject: [PATCH 8/9] Added correct replacement syntax --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 0e0cc72..51ec197 100644 --- a/action.yml +++ b/action.yml @@ -75,7 +75,7 @@ runs: run: | mkdir mpy-cross cd mpy-cross - wget -O mpy-cross https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross/linux-amd64/mpy-cross-linux-amd64-{{ inputs.mpy-cross-version }}.static + wget -O mpy-cross https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross/linux-amd64/mpy-cross-linux-amd64-${{ inputs.mpy-cross-version }}.static chmod +x mpy-cross - name: Compile MPY files shell: bash From 90a9cd8dfabe6d804761ef3441f7b1bf96cdbaa3 Mon Sep 17 00:00:00 2001 From: Jake1164 Date: Tue, 18 Feb 2025 09:40:48 -0500 Subject: [PATCH 9/9] Corrected default version to 9.2.4 --- README.rst | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 89d395a..6ada99a 100644 --- a/README.rst +++ b/README.rst @@ -20,7 +20,7 @@ Inputs Argument Name Description Default Notes ======================= ===================================================================== ==================== ===================================================================== github-token Your GitHub token N/A N/A -mpy-cross-version The version of mpy-cross to download and use 8.0.5 You can specify any version from ``https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross/linux-amd64`` +mpy-cross-version The version of mpy-cross to download and use 9.2.4 You can specify any version from ``https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross/linux-amd64`` zip-filename The name of the ZIP file that will be attached "mpy-release.zip" N/A mpy-directory The directory to search for files to compile "." (top folder) Becomes the basis for filepaths in ``mpy-manifest-file`` 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 diff --git a/action.yml b/action.yml index 51ec197..8dd8fb4 100644 --- a/action.yml +++ b/action.yml @@ -11,7 +11,7 @@ inputs: mpy-cross-version: description: 'The version of mpy-cross to use' required: true - default: "8.2.4" + default: "9.2.4" zip-filename: description: 'The name of the ZIP file to attach' required: true