-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.67 KB
/
release.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
name: Release boxes
on:
push:
pull_request:
workflow_dispatch:
inputs:
version:
required: true
description: Version of Vagrant box to release
jobs:
run-packer-release:
runs-on: macos-12
env:
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VAGRANT_CLOUD_TOKEN: ${{ secrets.VAGRANT_CLOUD_TOKEN }}
strategy:
fail-fast: false
matrix:
version: [win81, win10]
steps:
- name: Prepare environment
run: |
brew install make
INPUT=${{ inputs.version }}
[ -n "$INPUT" ] && echo "PKR_VAR_version=$INPUT" >> $GITHUB_ENV \
|| echo "Workflow input not given"
- name: Checkout repository
uses: actions/checkout@v3
- name: Download Vagrant box file
run: |
BOX_FILE=box/virtualbox/${{ matrix.version }}.box
BOX_URL=https://vagrantcloud.com/techneg/boxes/
BOX_URL+=test-${{ matrix.version }}x64-pro-salt/versions/
BOX_URL+=${{ inputs.version }}/providers/virtualbox.box
mkdir -p "${BOX_FILE%/*}"
case ${{ github.event_name }} in
workflow_dispatch)
wget --no-verbose -O "$BOX_FILE" "$BOX_URL"
;;
esac
- name: Packer release
env:
PKR_VAR_prefix: ~
run: |
cd upload && gmake main.cat.pkr.hcl
case ${{ github.event_name }} in
workflow_dispatch)
packer build -timestamp-ui -force -only \*.${{ matrix.version }} .
;;
*)
packer inspect .
packer validate -only \*.${{ matrix.version }} .
;;
esac