forked from 9l/vyos-build-action
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (102 loc) · 4.52 KB
/
vyos-v1.3.x-equuleus.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: VyOS v1.3.x LTS Release
on:
push:
tags:
- 'v1.3.*'
env:
GIT_CLONE_URL: https://github.com/vyos/vyos-build
DEBIAN_MIRROR: http://ftp.us.debian.org/debian/
BRANCH: equuleus
BUILD_ARCH: amd64
BUILD_BY: [email protected]
BUILD_TYPE: release
BUILD_VERSION: 1.3.2
BUILD_QEMU: true
BUILD_QCOW2: true
BUILD_HYPERV: true
BUILD_VMWARE: true
PACKER_JSON_PATCH: false
PACKER_JSON_PATCH_FILE: packer.json_wait-time_equuleus.patch
VMWARE_OVFTOOL: VMware-ovftool-4.4.1-16812187-lin.x86_64.bundle
VMWARE_PRIVATE_KEY: private_key_for_signing_vmware_image.pem
ARTIFACTS_DIR: artifacts
WORKING_DIR: vyos-build
STATUS_SUCCESS: "::set-output name=status::success"
jobs:
build:
runs-on: ubuntu-latest
container:
image: vyos/vyos-build:equuleus
options: --workdir /vyos --privileged
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Clone Source Code
run: |
git clone -b $BRANCH --single-branch $GIT_CLONE_URL $WORKING_DIR
cd $WORKING_DIR
./configure --architecture $BUILD_ARCH --build-by $BUILD_BY --build-type $BUILD_TYPE --version $BUILD_VERSION
mkdir -p ./$ARTIFACTS_DIR
- name: Build ISO Image
id: iso
working-directory: ./${{ env.WORKING_DIR }}
run: |
make iso && echo $STATUS_SUCCESS
cp -f ./build/vyos-$BUILD_VERSION-$BUILD_ARCH.iso ./$ARTIFACTS_DIR/
- name: Build QEMU Image
id: qemu
working-directory: ./${{ env.WORKING_DIR }}
if: steps.iso.outputs.status == 'success' && env.BUILD_QEMU == 'true'
run: |
[ $PACKER_JSON_PATCH = true ] && git apply $GITHUB_WORKSPACE/patchs/$PACKER_JSON_PATCH_FILE
[ -e ./build/live-image-$BUILD_ARCH.hybrid.iso ] && make qemu && echo $STATUS_SUCCESS
cp -f ./packer_build/qemu/vyos_qemu_image.img ./$ARTIFACTS_DIR/vyos-$BUILD_VERSION-$BUILD_ARCH-qemu.img
cp -f ./build/vyos-$BUILD_VERSION-$BUILD_ARCH.qcow2 ./$ARTIFACTS_DIR/vyos-$BUILD_VERSION-$BUILD_ARCH-qemu.qcow2
- name: Build Hyper-V Image
working-directory: ./${{ env.WORKING_DIR }}
if: steps.qemu.outputs.status == 'success' && env.BUILD_HYPERV == 'true'
run: |
[ -e ./packer_build/qemu/vyos_qemu_image.img ] && make hyperv
cp -f ./packer_build/hyperv/vyos_hyperv_image.vhd ./$ARTIFACTS_DIR/vyos-$BUILD_VERSION-$BUILD_ARCH-hyperv.vhd
- name: Build VMware Image
working-directory: ./${{ env.WORKING_DIR }}
if: steps.qemu.outputs.status == 'success' && env.BUILD_VMWARE == 'true'
run: |
export PRIVATE_KEY_PATH="$GITHUB_WORKSPACE/tools/$VMWARE_PRIVATE_KEY"
$GITHUB_WORKSPACE/tools/$VMWARE_OVFTOOL --eulas-agreed
[ -e ./packer_build/qemu/vyos_qemu_image.img ] && make vmware
cp -f ./build/vyos_vmware_image-signed.cert ./$ARTIFACTS_DIR/
cp -f ./build/vyos_vmware_image-signed-disk1.vmdk ./$ARTIFACTS_DIR/
cp -f ./build/vyos_vmware_image-signed.mf ./$ARTIFACTS_DIR/
cp -f ./build/vyos_vmware_image-signed.ovf ./$ARTIFACTS_DIR/
cp -f ./build/vyos_vmware_image-signed.ova ./$ARTIFACTS_DIR/vyos-$BUILD_VERSION-$BUILD_ARCH-vmware-signed.ova
cp -f ./build/vyos_vmware_image.vmdk ./$ARTIFACTS_DIR/vyos-$BUILD_VERSION-$BUILD_ARCH-vmware.vmdk
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: vyos-${{ env.BUILD_VERSION }}-${{ env.BUILD_ARCH }}-images
path: ${{ env.WORKING_DIR }}/${{ env.ARTIFACTS_DIR }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: vyos-${{ env.BUILD_VERSION }}-${{ env.BUILD_ARCH }}-images
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: VyOS v${{ env.BUILD_VERSION }} LTS Release
body: VyOS v${{ env.BUILD_VERSION }} LTS Release
draft: false
prerelease: false
files: |
vyos-${{ env.BUILD_VERSION }}-${{ env.BUILD_ARCH }}.iso
vyos-${{ env.BUILD_VERSION }}-${{ env.BUILD_ARCH }}-qemu.img
vyos-${{ env.BUILD_VERSION }}-${{ env.BUILD_ARCH }}-qemu.qcow2
vyos-${{ env.BUILD_VERSION }}-${{ env.BUILD_ARCH }}-hyperv.vhd
vyos-${{ env.BUILD_VERSION }}-${{ env.BUILD_ARCH }}-vmware-signed.ova
vyos-${{ env.BUILD_VERSION }}-${{ env.BUILD_ARCH }}-vmware.vmdk