This commit is contained in:
Sergey Ladanov 2023-11-13 09:12:49 +03:00
commit e8431f7f0b
6 changed files with 133 additions and 0 deletions

View File

@ -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

36
Dockerfile Normal file
View File

@ -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" ]

27
README.md Normal file
View File

@ -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
```

13
action.yml Normal file
View File

@ -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 }}

10
docker-compose.yml Normal file
View File

@ -0,0 +1,10 @@
version: '2'
services:
arm-gcc:
container_name: arm-gcc
build:
context: .
dockerfile: Dockerfile
args:
- VERSION=12.3.1-1.1

5
entrypoint.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
. /etc/bashrc
exec $@