v923z / micropython-builder

Ready-to-run firmware files with micropython and ulab
MIT License
29 stars 13 forks source link

Added pico w #9

Closed sakluk closed 1 year ago

sakluk commented 1 year ago

I added pico_w.sh and compilation steps to build.yml

sakluk commented 1 year ago

I got compilation errors in my fork. Don't know how to solve them. For more details, see: https://github.com/sakluk/micropython-builder/pull/1

v923z commented 1 year ago

I think this can be done in a much simpler way. Basically, you have to add the section

      - name: Compile for raspberry py pico_w
        if: always()
        run: ./scripts/rp2/pico_w.sh

to https://github.com/v923z/micropython-builder/blob/master/.github/workflows/build.yml, (you don't need template.yml) and add a file called 'pico_w.sh` to the scripts. This file should contain

#!/bin/bash

#  This file is part of the micropython-builder project,
#  https://github.com/v923z/micropython-builder
#  The MIT License (MIT)
#  Copyright (c) 2023 Sakari Lukkarinen

source ./scripts/rp2/rp2.sh

build_rp2 "PICO_W"

You already have this, and if the permissions are correct on the local machine, then you shouldn't need to set that in a workflow file.

Sorry, if it was confusing.

sakluk commented 1 year ago

No worries, I'm now on a deep learning curve.

I'm doing the changes manually at Fithub's editor. That might be the reason I got the permission denied errors. I try next to make the changes in my Linux and push them back here (Github).

v923z commented 1 year ago

I think this should be OK now, except that you don't need https://github.com/sakluk/micropython-builder/blob/master/pico_w.sh in the root. pico_w.sh is already in scripts, and actually, that is the file that you refer to in the workflow.

sakluk commented 1 year ago

I don't know how to clean this mess :-o. For me it is ok, if you think this is valuable addition and you want to add it there, please do.

I believe I need to take Introduction to GitHub course ...

v923z commented 1 year ago

I don't know how to clean this mess :-o. For me it is ok, if you think this is valuable addition and you want to add it there, please do.

There is no mess here, don't worry. Just don't believe this before I merge it;-)

v923z commented 1 year ago

@sakluk There is still a problem with the permission, so the script can't be executed. As I said, you've got to fix this on the local computer. This is how you can do that: https://aileenrae.co.uk/blog/github-actions-shell-script-permission-denied-error/

I don't want to frustrate you with this any longer, so if you want, we can close this PR, and I upload the modifications from my side. Your name would still be in the script.

sakluk commented 1 year ago

Now I managed to push the pico_w.sh file that has the execution rights from my local environment. The build process for Pico W is ok, but the last step still fails, see: https://github.com/sakluk/micropython-builder/actions/runs/4234972184.

By all means, please, add it to your master. I'm content with that :-D

v923z commented 1 year ago

Fixed in https://github.com/v923z/micropython-builder/pull/10. @sakluk I'm sorry for the disappointing experience. The usual way of doing this is

  1. Fort a repository
  2. create a new branch
  3. implement and test your modifications in your own branch
  4. once you are satisfied, create a pull request

The problem is that your options to test something in a foreign repository are limited. On the other hand, you have complete control over your own fork, you can modify things, run the workflow, debug.

In this case, you could have simply copied pico.sh, and modified that file. That way, you would have retained the permissions.

I hope that you are not disheartened. Once you get the hang of git, it is a really useful tool.