Skip to content

Commit

Permalink
feat(ci): Build per architecture
Browse files Browse the repository at this point in the history
Signed-off-by: txtsd <code@ihavea.quest>
  • Loading branch information
txtsd committed Feb 28, 2024
1 parent 4d66577 commit a0571ba
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,46 @@ defaults:
shell: bash

jobs:
determine_architectures:
runs-on: ubuntu-latest
outputs:
architectures: ${{ steps.extract-architectures.outputs.architectures }}

steps:
- name: Check out code
uses: actions/checkout@v4
- name: Update system and install dependencies
run: |
sed -i 's/#\[multilib\]/\[multilib\]/' /etc/pacman.conf
pacman-key --init
pacman -Syu --noconfirm
pacman -S --noconfirm --needed fd
- name: Extract architectures
id: extract-architectures
run: |
for file in $(fd --type f -- PKGBUILD)
do
source $file
echo ${arch[@]}
if [ $arch != 'any' ]
then
echo "archictectures=${arch[@]}" >> $GITHUB_OUTPUT
else
echo "architectures=('x86_64')" >> $GITHUB_OUTPUT
fi
done
build:
name: Build
runs-on: ubuntu-latest
container: archlinux:base-devel
needs: determine_architectures
if: ${{ inputs.packages != '[]' && inputs.packages != '[""]' && inputs.packages != '' }}
strategy:
matrix:
package: ${{ fromJson(inputs.packages) }}
arch: ${{ fromJson(needs.determine_architectures.outputs.architectures) }}
fail-fast: false

steps:
Expand Down

0 comments on commit a0571ba

Please sign in to comment.