Build aarch64 packages with GitHub actions

Signed-off-by: Timothy Middelkoop <tmiddelkoop@internet2.edu>
This commit is contained in:
Timothy Middelkoop
2025-03-05 02:55:31 +00:00
parent a98ec09b36
commit ab69de476f
4 changed files with 92 additions and 73 deletions

View File

@@ -20,6 +20,10 @@ inputs:
event-id: event-id:
description: "Github event id" description: "Github event id"
required: true required: true
upload-source:
description: "Upload source"
required: false
default: 'false'
runs: runs:
using: "composite" using: "composite"
@@ -74,6 +78,7 @@ runs:
path: /var/lib/mock/${{ inputs.target }}/result/${{ env.RPM }} path: /var/lib/mock/${{ inputs.target }}/result/${{ env.RPM }}
- name: Upload SRPM - name: Upload SRPM
if: ${{ inputs.upload-source == 'true' }}
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ env.SRPM }} name: ${{ env.SRPM }}

View File

@@ -7,64 +7,70 @@ on:
- cron: '05 00 * * *' - cron: '05 00 * * *'
jobs: jobs:
generate: generate:
name: Generate spec, dist and collect commits info name: Generate spec, dist and collect commits info
runs-on: ubuntu-latest runs-on: ubuntu-24.04
outputs: outputs:
should-continue: ${{ steps.generate.outputs.should-continue }} should-continue: ${{ steps.generate.outputs.should-continue }}
version: ${{ steps.generate.outputs.version }} version: ${{ steps.generate.outputs.version }}
release-id: ${{ steps.generate.outputs.release-id }} release-id: ${{ steps.generate.outputs.release-id }}
permissions: write-all permissions: write-all
steps: steps:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ./.github/actions/generate - name: generate warewulf spec, dist and collect commits info
name: generate warewulf spec, dist and collect commits info uses: ./.github/actions/generate
id: generate id: generate
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
event-id: ${{ github.event.release.id }} event-id: ${{ github.event.release.id }}
publish: publish:
name: Build and publish releases name: Build and publish releases
runs-on: ubuntu-latest runs-on: ${{ matrix.runs-on }}
needs: generate needs: generate
if: needs.generate.outputs.should-continue == 'true' if: needs.generate.outputs.should-continue == 'true'
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: arch: [x86_64, aarch64]
- target: rocky+epel-8-x86_64 dist: [el9, el8, suse.lp155]
arch: x86_64 include:
dist: el8 - dist: el8
- target: rocky+epel-9-x86_64 target: rocky+epel-8 #-arch
arch: x86_64 - dist: el9
dist: el9 target: rocky+epel-9
- target: opensuse-leap-15.5-x86_64 - dist: suse.lp155
arch: x86_64 target: opensuse-leap-15.5
dist: suse.lp155 - arch: x86_64
permissions: write-all runs-on: ubuntu-24.04
upload-source: 'true'
- arch: aarch64
runs-on: ubuntu-24.04-arm
steps: permissions: write-all
- name: Install git
run: | steps:
dnf install -y git - name: Install git
- name: Checkout Code run: |
uses: actions/checkout@v4 dnf install -y git
with: - name: Checkout Code
fetch-depth: 0 uses: actions/checkout@v4
- uses: ./.github/actions/rpm with:
name: build rpms fetch-depth: 0
id: rpm - name: build rpms
with: uses: ./.github/actions/rpm
dist: ${{ matrix.dist }} id: rpm
arch: ${{ matrix.arch }} with:
target: ${{ matrix.target }} dist: ${{ matrix.dist }}
token: ${{ secrets.GITHUB_TOKEN }} arch: ${{ matrix.arch }}
version: ${{ needs.generate.outputs.version }} target: ${{ matrix.target }}-${{ matrix.arch }}
event-id: ${{ needs.generate.outputs.release-id }} token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ needs.generate.outputs.version }}
event-id: ${{ needs.generate.outputs.release-id }}
upload-source: ${{ matrix.upload-source }}

View File

@@ -41,24 +41,26 @@ jobs:
rpm: rpm:
name: Build RPMs name: Build RPMs
needs: dist needs: dist
runs-on: ubuntu-latest runs-on: ${{ matrix.runs-on }}
container: container:
image: rockylinux/rockylinux:9 image: rockylinux/rockylinux:9
options: --privileged options: --privileged
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
arch: [x86_64, aarch64]
dist: [el9, el8, suse.lp155]
include: include:
- target: rocky+epel-8-x86_64 - dist: el8
arch: x86_64 target: rocky+epel-8 #-arch
dist: el8 - dist: el9
- target: rocky+epel-9-x86_64 target: rocky+epel-9
arch: x86_64 - dist: suse.lp155
dist: el9 target: opensuse-leap-15.5
- target: opensuse-leap-15.5-x86_64 - arch: x86_64
arch: x86_64 runs-on: ubuntu-24.04
dist: suse.lp155 - arch: aarch64
runs-on: ubuntu-24.04-arm
steps: steps:
- name: Prepare mock and rpm-build - name: Prepare mock and rpm-build
run: | run: |
@@ -73,13 +75,13 @@ jobs:
- name: Build RPMs and run tests - name: Build RPMs and run tests
run: | run: |
mock -r ${{ matrix.target }} --rebuild --spec=warewulf.spec --sources=. \ mock -r ${{ matrix.target }}-${{ matrix.arch }} --rebuild --spec=warewulf.spec --sources=. \
&& mock -r ${{ matrix.target }} --chroot -- bash -c "make -C /builddir/build/BUILD/warewulf-*/ test" && mock -r ${{ matrix.target }}-${{ matrix.arch }} --chroot -- bash -c "make -C /builddir/build/BUILD/warewulf-*/ test"
- name: Attach RPM and SRPM to release - name: Attach RPM and SRPM to release
uses: xresloader/upload-to-github-release@v1 uses: xresloader/upload-to-github-release@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
file: "/var/lib/mock/${{ matrix.target }}/result/warewulf-*.rpm" file: "/var/lib/mock/${{ matrix.target }}-${{ matrix.arch }}/result/warewulf-*.rpm"
tags: true tags: true

View File

@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## v4.6.1, unreleased
### Changed
- Update GitHub actions to build aarch64 artifacts.
## v4.6.0, 2025-03-02 ## v4.6.0, 2025-03-02
### Added ### Added