From 89350b5a540dd06ce26470a535822146a2d88696 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 27 May 2022 08:46:08 -0500 Subject: [PATCH] Add building to build workflow --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 537c56e..e849bac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: id: distros run: |- set -eo pipefail - distros=$(ls distros/ | jq -cRs 'split("\n") | [ .[] | if length > 0 then . else empty end ]') + distros=$(ls distros/*.hcl | jq -cRs 'split("\n") | [ .[] | if length > 0 then . else empty end ]') echo "::set-output name=distros::${distros}" build: @@ -27,8 +27,28 @@ jobs: fail-fast: false matrix: distro: ${{ fromJson( needs.collect.outputs.distros ) }} + packer_version: + - "1.8.0" steps: - uses: actions/checkout@v3 - - name: Echo name - run: |- - echo ${{ matrix.distro }} + with: + submodules: 'recursive' + - name: install dependencies + shell: bash + run: | + set -e + sudo apt-get update + sudo apt-get install -y unzip qemu-system-{x86,ppc} + # Install packer.io + curl -O https://releases.hashicorp.com/packer/${{ matrix.packer_version }}/packer_${{ matrix.packer_version }}_linux_amd64.zip + unzip packer_${{ matrix.packer_version }}_linux_amd64.zip + mv packer packerio + chmod +x packerio + - name: try build + shell: bash + run: | + set -e + ./packerio build -var-file=${{ matrix.distro }} -except=upload sources + env: + VAGRANT_CLOUD_TOKEN: ${{ secrets.VAGRANT_CLOUD_TOKEN }} + PACKER_LOG: 1