diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..15baf5d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +name: Build Project + +on: + push: + branches: '*' + pull_request: + branches: '*' + release: + types: published + +jobs: + build-projects: + runs-on: ubuntu-latest + name: Build & upload hex + steps: + - uses: actions/checkout@v4 + - name: Build all projects + run: docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:v2.0.0 yotta build + - name: Upload hex file + uses: actions/upload-artifact@v4 + with: + name: error-programme + path: build/bbc-microbit-classic-gcc/src/error-programme-combined.hex + if-no-files-found: error + + release-asset: + name: Upload artifact as GH Release asset + needs: build-projects + if: github.event_name == 'release' + runs-on: ubuntu-latest + steps: + - name: Set the GH Release tag to env variable $TAG + run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Download all hex file + uses: actions/download-artifact@v4 + id: download-hex-files + - name: Upload hex file to GH Release + uses: microbit-foundation/upload-release-action@2.9.0 + with: + file: ${{steps.download-hex-files.outputs.download-path}}/error-programme/error-programme-combined.hex + asset_name: error-programme-${{ env.TAG }}.hex diff --git a/README.md b/README.md index 7d7bbce..64fb65a 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ for V2-only programmes. ## Dependencies +Local toolchain: - [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) - [Git](https://git-scm.com) - [CMake](https://cmake.org/download/) @@ -17,14 +18,19 @@ for V2-only programmes. - [Ninja](https://ninja-build.org/) - [Yotta](https://yottabuild.org/) -Or Docker. +Or with Docker we only need the `ghcr.io/carlosperate/microbit-toolchain` +image. ## Build Instructions +Build with local toolchain: ``` yotta build ``` +Build with docker: ``` -docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:latest yotta build +docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:v2.0.0 yotta build ``` + +Output file: `build/bbc-microbit-classic-gcc/src/error-programme-combined.hex` \ No newline at end of file diff --git a/module.json b/module.json index 3a7e405..23780d9 100644 --- a/module.json +++ b/module.json @@ -1,7 +1,7 @@ { "name": "error-programme", "version": "1.0.0", - "description": "The micro:bit runtime common abstraction with examples.", + "description": "A micro:bit V1 programme to scroll 'not compatible' error code.", "license": "MIT", "dependencies": { "microbit": "lancaster-university/microbit#v2.1.1"