Skip to content
Draft
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
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,51 @@ jobs:
--body "
$(git-cliff -o - --current)
"

create-oci-release:
if: ${{ github.ref_name == 'main' }}
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-latest-arm' || 'ubuntu-latest' }}
permissions:
contents: write
strategy:
matrix:
arch: [amd64, arm64]

steps:
- name: Checkout commit
uses: actions/checkout@v6
with:
sparse-checkout: |
src/oci
sparse-checkout-cone-mode: false
- uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@main
- name: Get the Git tag name
id: get-tag-name
run: echo "tag-name=${GITHUB_REF/refs\/tags\//}" | tee -a "$GITHUB_OUTPUT"
- name: Create OCI container and release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gl-oci build-container \
--container "ghcr.io/${{ github.repository }}/container" \
--tag "${{ matrix.arch }}-${{ steps.get-tag-name.outputs.tag-name }}" \
--oci_archive "container_${{ matrix.arch }}.oci" \
--platform linux/${{ matrix.arch }} \
--dir "src/oci" \
--build_arg GL_VERSION=$GL_VERSION \
--build_arg PY_GL_VERSION="${{ steps.get-tag-name.outputs.tag-name }}"

gl-oci push-container \
--container "ghcr.io/${{ github.repository }}/container" \
--tag "${{ matrix.arch }}-${{ steps.get-tag-name.outputs.tag-name }}"

gl-oci add-container-to-index \
--index "ghcr.io/${{ github.repository }}/container" \
--index-tag "${{ steps.get-tag-name.outputs.tag-name }}" \
--container "ghcr.io/${{ github.repository }}/container" \
--tag "${{ matrix.arch }}-${{ steps.get-tag-name.outputs.tag-name }}"
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # pin@v7.0.0
with:
name: container-${{ matrix.arch }}
path: container_${{ matrix.arch }}.oci
if-no-files-found: error
24 changes: 24 additions & 0 deletions src/oci/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG GL_VERSION=2150.0.0
ARG PY_GL_VERSION=0.10.20

FROM ghcr.io/gardenlinux/gardenlinux:${GL_VERSION} as installer

ARG PY_GL_VERSION
ENV PY_GL_VERSION=${PY_GL_VERSION}

RUN apt-get update
RUN apt-get install -y ca-certificates git python3 python3-pip
RUN mkdir -p /opt/app
RUN python3 -m venv --system-site-packages --without-pip /opt/app
RUN /opt/app/bin/python -m pip install git+https://github.com/gardenlinux/python-gardenlinux-lib.git@${PY_GL_VERSION}

FROM ghcr.io/gardenlinux/gardenlinux:${GL_VERSION} as base
LABEL org.opencontainers.image.source="https://github.com/gardenlinux/python-gardenlinux-lib"

RUN apt-get update
RUN apt-get install -y podman python3

COPY --from=installer /opt/app /opt/app

WORKDIR /opt/app
ENTRYPOINT ["/opt/app/bin/gl-oci"]
Loading