Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V6.13.0 #2

Merged
merged 20 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Development Build

on:
pull_request:
branches:
- main
types:
- opened
- synchronize

jobs:
dev-build:
runs-on: ubuntu-latest

permissions:
packages: write
contents: read

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Extract Version for Dev Build
id: versioning
run: |
branch_name=${{ github.head_ref }}
if [[ "$branch_name" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version=${branch_name#v}
echo "version=$version" >> $GITHUB_OUTPUT
echo "tags=ghcr.io/thunderatz/stm32cubemx:${version}-dev" >> $GITHUB_OUTPUT
else
echo "Error: Branch name must follow 'vx.y.z' pattern." >&2
exit 1
fi
shell: bash

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Dev Docker Image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.versioning.outputs.tags }}
cache-from: type=registry,ref=ghcr.io/thunderatz/stm32cubemx:${{ steps.versioning.outputs.version }}
cache-to: type=inline
58 changes: 58 additions & 0 deletions .github/workflows/prod-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Production Build

on:
pull_request:
branches:
- main
types:
- closed

jobs:
prod-build:
if: github.event.pull_request.merged == true

runs-on: ubuntu-latest

permissions:
packages: write
contents: read

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Extract Version for Production Build
id: versioning
run: |
branch_name=${{ github.head_ref }}
if [[ "$branch_name" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version=${branch_name#v}
echo "version=$version" >> $GITHUB_OUTPUT
echo "tags=ghcr.io/thunderatz/stm32cubemx:${version},thunderatz/stm32cubemx:${version}" >> $GITHUB_OUTPUT
else
echo "Error: Branch name must follow 'vx.y.z' pattern." >&2
exit 1
fi
shell: bash

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and Push Production Docker Image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.versioning.outputs.tags }}
cache-from: type=registry,ref=ghcr.io/thunderatz/stm32cubemx:${{ steps.versioning.outputs.version }}
cache-to: type=inline
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:24.04 AS stm32cubemx

RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y \
unzip \
xvfb \
wget \
openjdk-21-jre \
libgbm1 \
&& apt-get clean

RUN mkdir st && cd st && \
wget -nv https://sw-center.st.com/packs/resource/library/stm32cube_mx_v6130-lin.zip && \
unzip -q stm32cube_mx_v6130-lin.zip && \
unzip -q JavaJre.zip && \
mv MX /root/STM32CubeMX && \
mv jre /root/STM32CubeMX && \
cd .. && rm -rf st

ENV CUBE_PATH="/root/STM32CubeMX"

RUN echo "exit" > /root/cube-init && \
Xvfb :10 -ac > /dev/null & \
export DISPLAY=:10 && \
$CUBE_PATH/STM32CubeMX -q /root/cube-init && \
rm /root/cube-init && \
pkill -f Xvfb

WORKDIR /root
Loading