Skip to content

Commit

Permalink
chore/ci/cd): improve build
Browse files Browse the repository at this point in the history
  • Loading branch information
markuslf committed Jan 25, 2025
1 parent b3b243e commit 44dd003
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/lf-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ jobs:
id: 'generate-matrix'
run: |
distros="${{ inputs.distros }}"
echo "matrix=$distros" | jq --compact-output --raw-input '{"distros": split(",")}' >> $GITHUB_OUTPUT
matrix=$(echo "$distros" | jq --compact-output --raw-input '{"distros": split(",")}')
echo "matrix=$matrix" | j >> $GITHUB_OUTPUT
preparations:
runs-on:
Expand Down Expand Up @@ -88,31 +89,31 @@ jobs:
- 'preparations'
strategy:
matrix:
distros: '${{ fromJson(needs.set-matrix.outputs.matrix) }}'
distro: '${{ fromJson(needs.set-matrix.outputs.matrix).distros }}'
steps:
- name: 'Harden Runner'
uses: 'step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e' # v2.10.4
with:
egress-policy: 'audit'

- name: 'mkdir ${{ env.BASE_DIR }}/build/${{ matrix.distros }}'
run: 'mkdir ${{ env.BASE_DIR }}/build/${{ matrix.distros }}'
- name: 'mkdir ${{ env.BASE_DIR }}/build/${{ matrix.distro }}'
run: 'mkdir ${{ env.BASE_DIR }}/build/${{ matrix.distro }}'

- name: 'Build the container for ${{ matrix.distros }}'
- name: 'Build the container for ${{ matrix.distro }}'
run: >
podman build
--file "${{ env.BASE_DIR }}/repos/monitoring-plugins/build/${{ matrix.distros }}/Containerfile"
--tag "lfmp-build-${{ matrix.distros }}"
--file "${{ env.BASE_DIR }}/repos/monitoring-plugins/build/${{ matrix.distro }}/Containerfile"
--tag "lfmp-build-${{ matrix.distro }}"
- name: 'Build the packages for ${{ matrix.distros }}'
- name: 'Build the packages for ${{ matrix.distro }}'
run: >
podman run
--rm
--mount type=bind,source=${{ env.BASE_DIR }}/build/${{ matrix.distros }},destination=/build,relabel=private
--mount type=bind,source=${{ env.BASE_DIR }}/build/${{ matrix.distro }},destination=/build,relabel=private
--mount type=bind,source=${{ env.BASE_DIR }}/repos,destination=/repos,relabel=shared,ro=true
"lfmp-build-${{ matrix.distros }}"
"lfmp-build-${{ matrix.distro }}"
/bin/bash -x
/repos/monitoring-plugins/build/${{ matrix.distros }}/build.sh
/repos/monitoring-plugins/build/${{ matrix.distro }}/build.sh
${{ inputs.package-version || github.ref_name }}
${{ inputs.package-iteration || '1' }}
Expand Down

0 comments on commit 44dd003

Please sign in to comment.