Skip to content

Commit

Permalink
Fix building inside redhat/ubi8 container (#307)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pederhan and terjekv authored Oct 11, 2024
1 parent e672677 commit 6dc4f6a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6dc4f6a

Please sign in to comment.