Fix RPM builds

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-01-10 13:50:50 +00:00 committed by Megan Wilhite
parent 6b659c3c26
commit f987c30452
3 changed files with 56 additions and 63 deletions

View file

@ -0,0 +1,53 @@
name: Build Salt Packages
on:
- workflow_call
jobs:
rpm:
name: Build RPM
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- aarch64
container:
image: centos:7
steps:
- uses: actions/checkout@v3
- name: Download System Dependencies
run: |
yum -y update
yum -y install python3 python3-pip openssl git rpmdevtools rpmlint systemd-units
- name: Build RPM
env:
USE_STATIC_REQUIREMENTS: "1"
run: |
rpmbuild -bb --define="_salt_src $(pwd)" $(pwd)/pkg/rpm/salt.spec
- name: Upload RPMs
uses: actions/upload-artifact@v3
with:
name: salt-${{ matrix.arch }}-rpms
path: /root/rpmbuild/RPMS/${{ matrix.arch }}/*.rpm
retention-days: 7
- name: Set Exit Status
if: always()
run: |
python3 -c "import os; os.makedirs('exitstatus', exist_ok=True)"
echo "${{ job.status }}" > exitstatus/${{ github.job }}-linux-${{ matrix.arch }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus
if-no-files-found: error

View file

@ -1,60 +0,0 @@
name: Build Salt Packages
on:
- workflow_call
jobs:
rpm:
name: Build Salt RPM
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- aarch64
runs-on: ubuntu-latest
container:
image: centos/python-38-centos7:latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Download dependencies
run: |
yum -y update
yum -y install git rpmdevtools rpmlint libxcrypt-compat systemd-units
- name: Build RPM
run: |
rpmbuild -bb --define="_salt_src ." ./salt/pkg/rpm/salt.spec
- name: Create archive of RPMs
run: |
tar -cJf artifacts/salt-${{ matrix.arch }}-rpms.tar.xz /root/rpmbuild/RPMS
- name: Upload RPMs
uses: actions/upload-artifact@v3
with:
name: salt-${{ matrix.arch }}-rpms.tar.xz
path: artifacts/salt-${{ matrix.arch }}-rpms.tar.xz
retention-days: 7
# - name: Set Exit Status
# if: always()
# run: |
# python3 -c "import os; os.makedirs('exitstatus', exist_ok=True)"
# echo "${{ job.status }}" > exitstatus/${{ github.job }}-linux-${{ matrix.arch }}
# - name: Upload Exit Status
# if: always()
# uses: actions/upload-artifact@v3
# with:
# name: exitstatus
# path: exitstatus
# if-no-files-found: error

View file

@ -545,12 +545,12 @@ jobs:
if-no-files-found: error
build-salt-linux-packages:
name: Build Salt RPM
build-linux-packages:
name: Build Linux Packages
if: ${{ fromJSON(needs.prepare-ci.outputs.jobs)['self-hosted-runners'] }}
needs:
- prepare-ci
uses: ./.github/workflows/build-salt-linux-packages.yml
uses: ./.github/workflows/build-linux-packages.yml
build-windows-pkgs:
name: Build Windows Packages