From 6dc4f6a9a7cc64f261f889a89a44281bd1afed96 Mon Sep 17 00:00:00 2001 From: Peder Hovdan Andresen <107681714+pederhan@users.noreply.github.com> Date: Fri, 11 Oct 2024 23:18:46 +0200 Subject: [PATCH] Fix building inside redhat/ubi8 container (#307) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR makes the following changes to the build and publish workflow: - Installs git before trying to check out the repo - Installs binutils to get the dependency objdump objdump was installed by default in the CentOS 8 image, but not in redhat/ubi8 🙃 - Fixes the tag pattern to work with tags like 1.0.0a1, 1.0.0rc1, etc. Keeping the commit history so the pain I went through to change 18 lines is recorded for the world. --------- Co-authored-by: Terje Kvernes --- .github/workflows/publish.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1c5bb9e1..352631d7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ name: build mreg-cli on: push: tags: - - '[0-9]+.[0-9]+.[0-9]+**' + - '[0-9]+.[0-9]+.[0-9]+*' concurrency: group: build-mreg-cli-${{ github.head_ref }} @@ -18,7 +18,7 @@ jobs: # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#determining-when-to-use-contexts - name: Exit if not on master branch - if: ${{ github.ref == 'refs/heads/master' }} + if: ${{ github.ref == 'refs/heads/fix-building' }} run: exit -1 - name: Install uv @@ -52,14 +52,18 @@ jobs: - os: ubuntu-latest container: redhat/ubi8:latest runs-on: ${{ matrix.os }} - container: ${{ matrix.container }} + container: + image: ${{ matrix.container }} steps: - - uses: actions/checkout@v4 - - - name: install git in RHEL 8 container + - name: Install RHEL 8 dependencies if: contains(matrix.container, 'redhat/ubi8') - run: dnf install -y git + run: dnf install -y git binutils + + - name: Ensure git is available + run: git --version + + - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v2