Skip to content

Commit

Permalink
Merge pull request #11 from thin-edge/feat-build-multi-versions
Browse files Browse the repository at this point in the history
feat: build multiple opcua containers, one per main release
  • Loading branch information
reubenmiller authored Jun 25, 2024
2 parents 6737559 + aa74bee commit a305298
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
35 changes: 32 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: publish

on:
pull_request:
push:
tags:
- "*"
Expand All @@ -9,20 +10,47 @@ jobs:
# Wait until all other publishing jobs are finished
# before publishing the virtual packages (which are architecture agnostic)
publish-containers:
name: Publish Containers
name: ${{ matrix.target.image }} (${{ matrix.target.opcua_version }})
runs-on: ubuntu-20.04
env:
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
target:
# Keep the "opcua-device-gateway" image on the latest available version
# which should align with the Cumulocity version used on the cloud trial tenants (e.g. eu-latest.cumulocity.com)
- opcua_version: "1020.62.0"
image: opcua-device-gateway

- opcua_version: "1020.62.0"
image: opcua-device-gateway-1020

- opcua_version: "1018.0.308"
image: opcua-device-gateway-1018

- opcua_version: "1017.0.289"
image: opcua-device-gateway-1017

- opcua_version: "1016.0.327"
image: opcua-device-gateway-1016

- opcua_version: "1015.0.455"
image: opcua-device-gateway-1015

- opcua_version: "1014.0.413"
image: opcua-device-gateway-1014

steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
- uses: extractions/setup-just@v1
- uses: extractions/setup-just@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -40,7 +68,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
name=ghcr.io/thin-edge/opcua-device-gateway,enable=true
name=ghcr.io/thin-edge/${{ matrix.target.image }},enable=true
tags: |
type=raw,value={{tag}}
type=raw,value=latest
Expand All @@ -56,3 +84,4 @@ jobs:
build-args: |
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
VERSION=${{ matrix.target.opcua_version }}
1 change: 1 addition & 0 deletions containers/opcua-device-gateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ LABEL org.opencontainers.image.licenses="Apache 2.0"
LABEL org.opencontainers.image.url="https://thin-edge.io"
LABEL org.opencontainers.image.documentation="https://thin-edge.github.io/thin-edge.io/"
LABEL org.opencontainers.image.base.name="debian:11-slim"
LABEL com.cumulocity.image.opcua.version="$VERSION"

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down

0 comments on commit a305298

Please sign in to comment.