From 05c528f93901a4bd08c7038574021c5c12b38e7f Mon Sep 17 00:00:00 2001 From: Leo Soares Date: Mon, 15 Jan 2024 16:34:35 +0000 Subject: [PATCH] Initial commit --- .github/workflows/docker.yaml | 31 +++++++++++++++++++++++++++++++ Dockerfile | 32 ++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 .github/workflows/docker.yaml create mode 100644 Dockerfile create mode 100644 LICENSE diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..a7081ac --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,31 @@ +name: ci + +on: + push: + tags: + - '*' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ github.actor }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: + leojrfs/stm32-cmake-builder:${{github.ref_name}},leojrfs/stm32-cmake-builder:latest + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..285a57f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:12.4-slim + +ARG TOOLCHAIN_VERSION=11.3.rel1 +ARG TOOLCHAIN_PATH=/opt/gcc-arm-none-eabi + +RUN apt update \ + && apt install -y \ + curl \ + build-essential \ + cmake \ + ninja-build \ + xz-utils \ + git-core \ + && rm -rf /var/lib/apt/lists/* + +# get arm-none-eabi toolchain +RUN TARGET_ARCH="$(dpkg --print-architecture)"; \ + case "${TARGET_ARCH}" in \ + amd64) TOOLCHAIN_ARCH="x86_64";; \ + arm64) TOOLCHAIN_ARCH="aarch64";; \ + *) echo "'${TARGET_ARCH}' unsupported architecture" && exit 1;; \ + esac \ + && mkdir ${TOOLCHAIN_PATH} \ + && curl -Lo gcc-arm-none-eabi.tar.xz "https://developer.arm.com/-/media/Files/downloads/gnu/${TOOLCHAIN_VERSION}/binrel/arm-gnu-toolchain-${TOOLCHAIN_VERSION}-${TOOLCHAIN_ARCH}-arm-none-eabi.tar.xz" \ + && tar xf gcc-arm-none-eabi.tar.xz --strip-components=1 -C ${TOOLCHAIN_PATH} \ + && rm gcc-arm-none-eabi.tar.xz \ + && rm ${TOOLCHAIN_PATH}/*.txt \ + && rm -rf ${TOOLCHAIN_PATH}/share/doc \ + && rm -rf ${TOOLCHAIN_PATH}/share/man + +# add toolchain path to PATH +ENV PATH="${TOOLCHAIN_PATH}/bin:${PATH}" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9500481 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Leo Soares + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.