.github/workflows/build.yml #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_dispatch: | |
inputs: | |
builds: | |
description: 'Builds to build' | |
type: string | |
required: false | |
default: >- | |
[ | |
"ubuntu2310", | |
"fedora39", | |
"silverblue39", | |
"opensusetumbleweed", | |
"alpine319" | |
] | |
publish: | |
description: 'Publish to Vagrant Cloud' | |
type: boolean | |
default: false | |
required: false | |
env: | |
VAGRANT_CLOUD_TOKEN: ${{ secrets.VAGRANT_CLOUD_TOKEN }} | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
build: ${{ fromJSON(inputs.builds) }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hashicorp/[email protected] | |
- run: sudo apt-get update | |
- run: sudo apt-get install -y --no-install-recommends vagrant debian-archive-keyring ca-certificates | |
- run: vagrant plugin install vagrant-libvirt | |
- run: >- | |
echo | |
"deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] https://ftp.debian.org/debian/ trixie main" | |
| sudo tee /etc/apt/sources.list.d/trixie.list | |
- run: sudo apt-get update | |
- run: sudo apt-get install -y --no-install-recommends -t trixie qemu-system-x86 qemu-utils | |
- run: packer init . | |
- run: PACKER_LOG=1 packer build -only qemu.${{ matrix.build }} . | |
- run: >- | |
vagrant cloud publish | |
--force | |
--no-private | |
mezinalexander/${{ matrix.build }} | |
0.${{ github.run_number }}.${{ github.run_attempt }} | |
libvirt | |
packer_${{ matrix.build }}_libvirt_amd64.box | |
if: inputs.publish |