Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
33 changes: 33 additions & 0 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build Devcontainer Image

on:
push:
paths:
- '.devcontainer/Dockerfile'
- '.devcontainer/**'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # nötig für Push nach GHCR

steps:
- uses: actions/checkout@v4

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

- name: Build and push devcontainer
uses: docker/build-push-action@v5
with:
context: .
file: .devcontainer/Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/embedded-lib-dev:latest
36 changes: 20 additions & 16 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
name: Embedded Lib Conan Package
name: Conan Package

on:
push:
branches: [ main ]
tags: [ "*" ]
tags: [ "v*" ] # Nur Tags, die mit v beginnen (z.B. v1.2.3)
pull_request:

jobs:
build-and-publish:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository_owner }}/embedded-lib-dev:latest

permissions:
contents: read
packages: write

steps:
# 1. Checkout repo
- uses: actions/checkout@v4

# 2. Set up Docker Buildx
- name: Build dev container
with:
fetch-depth: 0 # wichtig, damit Tags verfügbar sind

# Version aus Git-Tag ableiten
- name: Extract version from tag
id: vars
run: |
docker build -t my-dev -f .devcontainer/Dockerfile .
docker run my-dev echo "Container built"
TAG=${GITHUB_REF#refs/tags/}
VERSION=${TAG#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT

# 2. Verify environment
- name: Check environment
run: |
which conan
conan --version
cmake --version
gcc --version

# 3. Configure Conan remote
- name: Configure Conan remote
run: |
conan remote add github "https://conan.pkg.github.com/${{ github.repository_owner }}" --force
Expand All @@ -37,15 +43,13 @@ jobs:
CONAN_LOGIN_USERNAME: ${{ github.actor }}
CONAN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

# 4. Create the package
- name: Create Conan package
run: |
conan create . --version=0.1.0 --user=${{ github.actor }} --channel=stable
conan create . --version=${{ steps.vars.outputs.version }} --user=${{ github.actor }} --channel=stable

# 5. Upload the package
- name: Upload package
- name: Upload Conan package
run: |
conan upload "*/0.1.0@" --all -r=github --confirm
conan upload "*/${{ steps.vars.outputs.version }}@" --all -r=github --confirm
env:
CONAN_LOGIN_USERNAME: ${{ github.actor }}
CONAN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading