[build] Use strategy matrix to run arm builds.

This commit is contained in:
Suresh Sundriyal 2023-07-08 10:25:17 -07:00
parent b22edd5a26
commit f4e666543d

View File

@ -27,7 +27,7 @@ jobs:
options: --platform linux/amd64
env:
LNAV_BASENAME: lnav-${{ inputs.lnav_version_number }}
LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-x86_64-linux-musl.zip
LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-linux-musl-x86_64.zip
steps:
- name: checkout
uses: actions/checkout@v3
@ -60,13 +60,19 @@ jobs:
asset_name: ${{ env.LNAV_ZIPNAME }}
asset_content_type: application/octet-stream
build-musl-armv7l:
build-arm:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- container-platform: linux/arm/v7
arch: armv7l
- container-platform: linux/arm64
arch: aarch64
env:
LNAV_BASENAME: lnav-${{ inputs.lnav_version_number }}
LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-armv7l-linux-musl.zip
LNAV_ARTIFACT: lnav-linux-musl-armv7l.zip
CONT_PLATFORM: linux/arm/v7
LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-linux-musl-${{ matrix.arch }}.zip
LNAV_ARTIFACT: lnav-linux-musl-${{ matrix.arch }}.zip
steps:
- name: checkout
uses: actions/checkout@v3
@ -76,53 +82,7 @@ jobs:
uses: addnab/docker-run-action@v3
with:
image: tstack/lnav-build:latest
options: -v ${{ github.workspace }}:/lnav -e GITHUB_WORKSPACE=/lnav --platform ${{ env.CONT_PLATFORM }}
run: /entrypoint.sh
- name: Build musl package
if: ${{ inputs.lnav_version_number != '' }}
run: >-
cd ${{ github.workspace }}
mkdir ${{ env.LNAV_BASENAME }} &&
cd ${{ env.LNAV_BASENAME }} &&
cp ../NEWS.md ../README . &&
cp ../lbuild/src/lnav . &&
cd .. &&
zip -r ${{ env.LNAV_ZIPNAME }} ${{ env.LNAV_BASENAME }}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
with:
# Artifact name
name: ${{ env.LNAV_ARTIFACT }}
# A file, directory or wildcard pattern that describes what to upload
path: ${{ github.workspace }}/lbuild/src/lnav
- name: Upload musl-binary archive
uses: actions/upload-release-asset@v1.0.2
if: ${{ inputs.upload_url != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.LNAV_ZIPNAME }}
asset_name: ${{ env.LNAV_ZIPNAME }}
asset_content_type: application/octet-stream
build-musl-arm64v8:
runs-on: ubuntu-latest
env:
LNAV_BASENAME: lnav-${{ inputs.lnav_version_number }}
LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-aarch64-linux-musl.zip
LNAV_ARTIFACT: lnav-linux-musl-aarch64.zip
CONT_PLATFORM: linux/arm64
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: make
uses: addnab/docker-run-action@v3
with:
image: tstack/lnav-build:latest
options: -v ${{ github.workspace }}:/lnav -e GITHUB_WORKSPACE=/lnav --platform ${{ env.CONT_PLATFORM }}
options: -v ${{ github.workspace }}:/lnav -e GITHUB_WORKSPACE=/lnav --platform ${{ matrix.container-platform }}
run: /entrypoint.sh
- name: Build musl package
if: ${{ inputs.lnav_version_number != '' }}