Reflow release.yml
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
committed by
Christian Goll
parent
a69a205820
commit
44090a5984
140
.github/workflows/release.yml
vendored
140
.github/workflows/release.yml
vendored
@@ -10,6 +10,7 @@ jobs:
|
|||||||
dist:
|
dist:
|
||||||
name: Checkout code and build warewulf.spec and dist
|
name: Checkout code and build warewulf.spec and dist
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set DIST
|
- name: Set DIST
|
||||||
run: |
|
run: |
|
||||||
@@ -43,81 +44,82 @@ jobs:
|
|||||||
file: ${{ env.DIST }}
|
file: ${{ env.DIST }}
|
||||||
|
|
||||||
rpm:
|
rpm:
|
||||||
name: Build RPMs
|
name: Build RPMs
|
||||||
needs: dist
|
needs: dist
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: rockylinux/rockylinux:9
|
image: rockylinux/rockylinux:9
|
||||||
options: --privileged
|
options: --privileged
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- target: rocky+epel-8-x86_64
|
- target: rocky+epel-8-x86_64
|
||||||
arch: x86_64
|
arch: x86_64
|
||||||
dist: el8
|
dist: el8
|
||||||
- target: rocky+epel-9-x86_64
|
- target: rocky+epel-9-x86_64
|
||||||
arch: x86_64
|
arch: x86_64
|
||||||
dist: el9
|
dist: el9
|
||||||
- target: centos+epel-7-x86_64
|
- target: centos+epel-7-x86_64
|
||||||
arch: x86_64
|
arch: x86_64
|
||||||
dist: el7
|
dist: el7
|
||||||
- target: opensuse-leap-15.5-x86_64
|
- target: opensuse-leap-15.5-x86_64
|
||||||
arch: x86_64
|
arch: x86_64
|
||||||
dist: suse.lp155
|
dist: suse.lp155
|
||||||
steps:
|
|
||||||
- name: Install EPEL
|
|
||||||
run: dnf -y install epel-release
|
|
||||||
|
|
||||||
- name: Install mock and rpm-build
|
steps:
|
||||||
run: |
|
- name: Install EPEL
|
||||||
dnf -y install mock rpm-build
|
run: dnf -y install epel-release
|
||||||
echo "config_opts['print_main_output'] = True" >>/etc/mock/site-defaults.cfg
|
|
||||||
|
|
||||||
- name: Download spec
|
- name: Install mock and rpm-build
|
||||||
uses: actions/download-artifact@v3
|
run: |
|
||||||
with:
|
dnf -y install mock rpm-build
|
||||||
name: warewulf.spec
|
echo "config_opts['print_main_output'] = True" >>/etc/mock/site-defaults.cfg
|
||||||
|
|
||||||
- name: Set the expected version
|
- name: Download spec
|
||||||
run: |
|
uses: actions/download-artifact@v3
|
||||||
echo "EXPECTED_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
with:
|
||||||
|
name: warewulf.spec
|
||||||
|
|
||||||
- name: Download dist
|
- name: Set the expected version
|
||||||
uses: actions/download-artifact@v3
|
run: |
|
||||||
with:
|
echo "EXPECTED_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
||||||
name: warewulf-${{ env.EXPECTED_VERSION }}.tar.gz
|
|
||||||
|
|
||||||
- name: Set RPM and SRPM
|
- name: Download dist
|
||||||
run: |
|
uses: actions/download-artifact@v3
|
||||||
VERSION=$(rpm -q --qf "%{VERSION}\n" --specfile warewulf.spec)
|
with:
|
||||||
GENERIC_RELEASE=$(rpm -q --qf "%{RELEASE}\n" --specfile warewulf.spec | cut -d. -f1-2)
|
name: warewulf-${{ env.EXPECTED_VERSION }}.tar.gz
|
||||||
RPM=warewulf-${VERSION}-${GENERIC_RELEASE}.${{ matrix.dist }}.${{ matrix.arch }}.rpm
|
|
||||||
SRPM=warewulf-${VERSION}-${GENERIC_RELEASE}.${{ matrix.dist }}.src.rpm
|
|
||||||
echo "RPM=${RPM}" >> $GITHUB_ENV
|
|
||||||
echo "SRPM=${SRPM}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build RPMs and run tests
|
- name: Set RPM and SRPM
|
||||||
run: |
|
run: |
|
||||||
mock -r ${{ matrix.target }} --rebuild --spec=warewulf.spec --sources=.
|
VERSION=$(rpm -q --qf "%{VERSION}\n" --specfile warewulf.spec)
|
||||||
mock -r ${{ matrix.target }} --chroot -- make -C /builddir/build/BUILD/warewulf-${{ env.EXPECTED_VERSION }} test
|
GENERIC_RELEASE=$(rpm -q --qf "%{RELEASE}\n" --specfile warewulf.spec | cut -d. -f1-2)
|
||||||
|
RPM=warewulf-${VERSION}-${GENERIC_RELEASE}.${{ matrix.dist }}.${{ matrix.arch }}.rpm
|
||||||
|
SRPM=warewulf-${VERSION}-${GENERIC_RELEASE}.${{ matrix.dist }}.src.rpm
|
||||||
|
echo "RPM=${RPM}" >> $GITHUB_ENV
|
||||||
|
echo "SRPM=${SRPM}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Upload RPM
|
- name: Build RPMs and run tests
|
||||||
uses: actions/upload-artifact@v3
|
run: |
|
||||||
with:
|
mock -r ${{ matrix.target }} --rebuild --spec=warewulf.spec --sources=.
|
||||||
name: ${{ env.RPM }}
|
mock -r ${{ matrix.target }} --chroot -- make -C /builddir/build/BUILD/warewulf-${{ env.EXPECTED_VERSION }} test
|
||||||
path: /var/lib/mock/${{ matrix.target }}/result/${{ env.RPM }}
|
|
||||||
|
|
||||||
- name: Upload SRPM
|
- name: Upload RPM
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.SRPM }}
|
name: ${{ env.RPM }}
|
||||||
path: /var/lib/mock/${{ matrix.target }}/result/${{ env.SRPM }}
|
path: /var/lib/mock/${{ matrix.target }}/result/${{ env.RPM }}
|
||||||
|
|
||||||
- name: Attach RPM and SRPM to release
|
- name: Upload SRPM
|
||||||
uses: xresloader/upload-to-github-release@v1
|
uses: actions/upload-artifact@v3
|
||||||
env:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
name: ${{ env.SRPM }}
|
||||||
with:
|
path: /var/lib/mock/${{ matrix.target }}/result/${{ env.SRPM }}
|
||||||
release_id: ${{ github.event.release.id }}
|
|
||||||
file: "/var/lib/mock/${{ matrix.target }}/result/${{ env.RPM }};/var/lib/mock/${{ matrix.target }}/result/${{ env.SRPM }}"
|
- name: Attach RPM and SRPM to release
|
||||||
|
uses: xresloader/upload-to-github-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
release_id: ${{ github.event.release.id }}
|
||||||
|
file: "/var/lib/mock/${{ matrix.target }}/result/${{ env.RPM }};/var/lib/mock/${{ matrix.target }}/result/${{ env.SRPM }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user