-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (58 loc) · 1.92 KB
/
build.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
on:
workflow_dispatch:
inputs:
builds:
description: 'Builds to build'
type: string
required: false
default: >-
[
"ubuntu2310",
"fedora39",
"silverblue39",
"opensusetumbleweed",
"alpine319",
"alpine318",
"opensuseleap155",
"centos9s",
"debian12"
]
publish:
description: 'Publish to Vagrant Cloud'
type: boolean
default: false
required: false
env:
VAGRANT_CLOUD_TOKEN: ${{ secrets.VAGRANT_CLOUD_TOKEN }}
PACKER_LOG: 1
jobs:
build:
strategy:
fail-fast: false
matrix:
build: ${{ fromJSON(inputs.builds) }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: >-
wget -O- https://apt.releases.hashicorp.com/gpg
| sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
- run: >-
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
| sudo tee /etc/apt/sources.list.d/hashicorp.list
- run: sudo apt-get update
- run: sudo apt-get install -y --no-install-recommends packer debian-archive-keyring ca-certificates
- 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: sudo apt-get clean -y
- run: packer init .
- run: >-
packer build
-var version=0.${{ github.run_number }}.${{ github.run_attempt }}
${{ !inputs.publish && '-except vagrant-cloud' || '' }}
-only qemu.${{ matrix.build }}
.