forked from chef/bento
-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (61 loc) · 1.71 KB
/
pkr-bld-hyperv-x64.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
on:
workflow_call:
env:
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
PACKER_LOG: "1"
jobs:
x86_64:
runs-on: [self-hosted, X64, hyperv]
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
- oraclelinux-7
- oraclelinux-8
- oraclelinux-9
- rockylinux-8
- rockylinux-9
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-23.10
provider:
- hyperv-iso
steps:
- name: Checkout
uses: actions/checkout@main
# - name: Setup Packer
# uses: hashicorp/setup-packer@main
# with:
# version: latest
- name: Bento build
run: packer build -timestamp-ui -only="${{ matrix.provider }}.vm" -var-file="os_pkrvars/$("${{ matrix.os }}".Split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates
- name: Remove VM in case of canceled job
if: cancelled()
run: |
echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64
Stop-VM -Force ${{ matrix.os }}*-amd64
sleep 1
Remove-VM -Force ${{ matrix.os }}*-amd64
sleep 2
- name: Upload build artifact
uses: actions/upload-artifact@main
with:
name: "${{ matrix.os }}-hyperv-x86_64"
path: |
builds/*.box
builds/*.json
retention-days: 10
compression-level: 0 # no compression