-
Notifications
You must be signed in to change notification settings - Fork 15
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 #6 from gurgleapps/dev
Dev
- Loading branch information
Showing
8 changed files
with
107 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Compile to MPY | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
# paths: | ||
# - '**.py' | ||
|
||
jobs: | ||
compile: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install Micropython | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential libreadline-dev libffi-dev git pkg-config | ||
git clone https://github.com/micropython/micropython.git | ||
cd micropython/mpy-cross | ||
make | ||
- name: list to see if it's there | ||
run: | | ||
ls -al ./micropython/mpy-cross/build | ||
- name: Compile .py files to .mpy | ||
run: | | ||
rm -rf mpy | ||
mkdir mpy | ||
find . -maxdepth 1 -name "*.py" ! -name "main.py" ! -name "config.py" -exec sh -c './micropython/mpy-cross/build/mpy-cross {} -o mpy/$(basename -s .py {}).mpy' \; | ||
- name: Remove micropython folder | ||
run: | | ||
rm -rf micropython | ||
- name: Commit .mpy files | ||
run: | | ||
git config --global user.name "GitHub Actions Bot" | ||
git config --global user.email "[email protected]" | ||
git add -A | ||
git commit -m "Auto-compiled .mpy files" || echo "No changes to commit" | ||
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | ||
git push || echo "No changes to push" |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.