commit e8431f7f0ba445d11ae9fcb278034c6166cd4db9 Author: Sergey Ladanov Date: Mon Nov 13 09:12:49 2023 +0300 init diff --git a/.github/workflows/build_docker_image.yml b/.github/workflows/build_docker_image.yml new file mode 100644 index 0000000..b3aa517 --- /dev/null +++ b/.github/workflows/build_docker_image.yml @@ -0,0 +1,42 @@ +name: Publish image + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + # Checkout repository + - name: Checkout code + uses: actions/checkout@v3 + + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: sergeyladanov/arm-gcc-xpack + + - 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: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + platforms: linux/amd64,linux/arm64 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7e5c147 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +FROM debian:stable-slim + +ARG VERSION=12.3.1-1.1 + +RUN ARCH="$(dpkg --print-architecture)" && \ + case $ARCH in \ + "amd64") \ + ARCH_TAG="x64" \ + ;; \ + "arm64") \ + ARCH_TAG="arm64" \ + ;; \ + esac && \ + # Get nessecary packages + apt-get update && \ + apt-get install \ + --no-install-recommends \ + make \ + cmake \ + wget \ + ca-certificates \ + -y && \ + rm -rf /var/cache/apt && \ + mkdir /workdir && \ + cd /workdir && \ + wget https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v${VERSION}/xpack-arm-none-eabi-gcc-${VERSION}-linux-${ARCH_TAG}.tar.gz && \ + tar xvf xpack-arm-none-eabi-gcc-${VERSION}-linux-${ARCH_TAG}.tar.gz && \ + rm xpack-arm-none-eabi-gcc-${VERSION}-linux-${ARCH_TAG}.tar.gz + +RUN echo 'export PATH="/workdir/xpack-arm-none-eabi-gcc-'${VERSION}'/bin:$PATH"' >> /etc/bashrc + +ADD entrypoint.sh /entrypoint.sh + +RUN chmod +x /entrypoint.sh + +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/README.md b/README.md new file mode 100644 index 0000000..bac93ce --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# arm-gcc-xpack-ci + +Building arm-gcc projects with xpack compilator + +## Usage: + +``` + +jobs: + build: + name: Building project + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: make + uses: embedd-actions/arm-gcc-ci@v12.3.1 + with: + command: make --directory Release all + +``` + +## List of available tags + +``` +v12.3.1 +``` diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..01952ee --- /dev/null +++ b/action.yml @@ -0,0 +1,13 @@ +name: 'ARM GCC build' +description: 'Building arm projects' +inputs: + command: + description: 'Command' + required: true + default: arm-none-eabi-gcc --version +runs: + using: 'docker' + image: 'docker://sergeyladanov/arm-gcc:v12.3.1' + args: + - ${{ inputs.command }} + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..00965df --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '2' + +services: + arm-gcc: + container_name: arm-gcc + build: + context: . + dockerfile: Dockerfile + args: + - VERSION=12.3.1-1.1 \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..9d48d31 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + + . /etc/bashrc + +exec $@