Skip to content
---
on:
workflow_call:
env:
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
jobs:
x86_64:
runs-on: [self-hosted, X64, parallels]
strategy:
fail-fast: false
matrix:
os:
# - almalinux-8
- almalinux-9
# - centos-7
# - centos-stream-8
# - centos-stream-9
# - debian-11
# - debian-12
# - fedora-38
# - fedora-39
# - freebsd-13
# - freebsd-14
# - opensuse-leap-15
# - oracle-7
# - oracle-8
# - oracle-9
# - rockylinux-8
# - rockylinux-9
# - ubuntu-20.04
# - ubuntu-22.04
# - ubuntu-23.10
provider:
- parallels-iso
- virtualbox-iso
steps:
- name: Checkout
uses: actions/checkout@main
- name: iso-availability
shell: pwsh
run: Invoke-RestMethod -Method Head -Verbose -Uri $(Get-Content os_pkrvars/$('${{ matrix.os }}'.split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl | ConvertFrom-StringData).iso_url.Trim('"')
- name: Install Virtualization Software
uses: ubuntu-latest
run: |
sudo apt-get update
sudo apt-get install -y parallels virtualbox qemu-kvm
- name: Packer Init
run: packer init -upgrade packer_templates
- name: Packer FMT
run: if packer fmt -check -recursive .; then exit 0; else echo "Some packer files need to be formatted, run 'packer fmt -recursive .' to fix"; exit 1; fi
- name: Packer Validate
run: packer validate -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates
- name: Packer build
# run: packer build -timestamp-ui -only=${{ matrix.provider }}.vm -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates
run: |
eval "$(chef shell-init bash)"
bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl"
ls -alh builds
# - name: Bento Test
# run: |
# eval "$(chef shell-init bash)"
# bento test
- name: Remove VM in case of canceled job
if: cancelled()
run: |
VM="$(prlctl list -a | grep ${{ matrix.os }} | cut -d " " -f 1)"
echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64
prlctl stop "$VM" --kill 2> /dev/null
sleep 1
prlctl delete "$VM" 2> /dev/null
sleep 2
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: "${{ matrix.os }}-parallels-x86_64"
path: |
builds
!builds/uploaded/*
retention-days: 10