diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbdb07e..d9fa2af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,11 +5,7 @@ on: [push, pull_request] jobs: build: runs-on: ubuntu-latest - container: - image: mcr.microsoft.com/cbl-mariner/base/core:2.0 steps: - - name: Install dependencies - run: unset HOME; tdnf install -y build-essential git tar rpm-build ca-certificates - uses: actions/checkout@v2 - - name: build - run: make rpm + - name: Build RPMs + run: docker build . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5dd325..2d65b9f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,19 +5,13 @@ on: push jobs: build: runs-on: ubuntu-latest - container: - image: mcr.microsoft.com/cbl-mariner/base/core:2.0 - permissions: - contents: write steps: - - name: Install dependencies - run: unset HOME; tdnf install -y build-essential git tar rpm-build ca-certificates - uses: actions/checkout@v2 - - name: build - run: make rpm + - name: Build RPMs + run: docker build -o out . - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: | - rpmbuild/RPMS/x86_64/*.rpm + out/*.rpm diff --git a/.gitignore b/.gitignore index bcc3cc7..647dc8f 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,5 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ rpmbuild/ + +out/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..234e3d2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 as cm2 +RUN tdnf install -y rpm-build make python3-devel +WORKDIR /src +RUN --mount=target=/src,rw make rpm && \ + mkdir /out && \ + cp -r /src/rpmbuild/RPMS/x86_64/*.rpm /out/ + +FROM registry.access.redhat.com/ubi9:latest as el9 +RUN yum install -y rpm-build make python3-devel +WORKDIR /src +RUN --mount=target=/src,rw make rpm && \ + mkdir /out && \ + cp -r /src/rpmbuild/RPMS/x86_64/*.rpm /out/ + +FROM registry.access.redhat.com/ubi8:latest as el8 +RUN yum install -y rpm-build make python3-devel +WORKDIR /src +RUN --mount=target=/src,rw make rpm && \ + mkdir /out && \ + cp -r /src/rpmbuild/RPMS/x86_64/*.rpm /out/ + +FROM scratch +COPY --from=cm2 /out/* / +COPY --from=el8 /out/* / +COPY --from=el9 /out/* / diff --git a/dnf-plugin-azure-auth.spec b/dnf-plugin-azure-auth.spec index 5044d1e..7a9ab48 100644 --- a/dnf-plugin-azure-auth.spec +++ b/dnf-plugin-azure-auth.spec @@ -13,6 +13,7 @@ URL: https://github.com/microsoft/dnf-plugin-azure-auth/ Source0: %{name}-%{version}.tar.gz %global debug_package %{nil} Requires: python3-dnf +BuildRequires: python3-devel %description DNF plugin for accessing repos in Azure Blob Storage via Azure AD @@ -34,5 +35,7 @@ cp azure_auth.conf %{buildroot}%{_sysconfdir}/dnf/plugins/azure_auth.conf %changelog +* Fri Oct 04 2024 Tom Fay - 0.1.0-2 +- Build for RHEL 8 and 9 * Thu Sep 19 2024 Tom Fay - 0.1.0-1 - Original version