Files
vms/.github/workflows/build.yml
T

55 lines
1.5 KiB
YAML

name: Build the boxes
"on":
workflow_dispatch:
jobs:
collect:
name: Discover distros
runs-on: ubuntu-latest
outputs:
distros: ${{ steps.distros.outputs.distros }}
steps:
- uses: actions/checkout@v3
- name: Discover boxes
id: distros
run: |-
set -eo pipefail
distros=$(ls distros/*.hcl | jq -cRs 'split("\n") | [ .[] | if length > 0 then . else empty end ]')
echo "::set-output name=distros::${distros}"
build:
name: Build box
runs-on: ubuntu-latest
needs:
- collect
strategy:
fail-fast: false
matrix:
distro: ${{ fromJson( needs.collect.outputs.distros ) }}
packer_version:
- "1.8.0"
steps:
- uses: actions/checkout@v3
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 }} -var "qemu_accelerator=none" -except=upload sources
env:
VAGRANT_CLOUD_TOKEN: ${{ secrets.VAGRANT_CLOUD_TOKEN }}
PACKER_LOG: 1