-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.49 KB
/
Copy pathbuild-micropython.yml
File metadata and controls
51 lines (41 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Build MicroPython WebAssembly
on:
push:
branches: [main]
paths:
- 'micropython'
workflow_dispatch: {}
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build Docker image
shell: bash
run: docker build -f dockerfile -t micropython-wasm-builder .
- name: Run build in Docker
shell: bash
run: |
# Use github.workspace instead of pwd to guarantee the correct mount path
docker run --rm -v "${{ github.workspace }}:/app" micropython-wasm-builder
# Fix ownership of files generated by Docker so Git can read/commit them
sudo chown -R $USER:$USER micropython-build/
- name: Commit and push build output
shell: bash
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add micropython-build
if git diff --cached --quiet; then
echo "Build output unchanged, nothing to commit."
exit 0
fi
SUBMODULE_SHA=$(git -C micropython rev-parse --short HEAD)
git commit -m "chore: rebuild micropython wasm (submodule @ ${SUBMODULE_SHA}) [skip ci]"
git push