forked from oVirt/ovirt-tinycore-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (71 loc) · 2.13 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
62
63
64
65
66
67
68
69
70
71
name: Build oVirt TinyCore
permissions:
issues: write
pull-requests: write
contents: write
on:
push:
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install GenISOImage
run: sudo apt update && sudo apt install -y genisoimage
- name: Install Packer
run: |
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update && sudo apt-get install packer
- name: Install QEMU
run: sudo apt update && sudo apt install -y qemu-utils qemu qemu-kvm gocr
- name: Run build script
run: sudo ./build.sh
- name: Run Packer
run: PACKER_LOG=1 packer build .
- name: Move all artifacts to a single directory
if: always()
run: |
mkdir output
cp -av builddir/oVirtTinyCore*.iso output/
cp -av qcowbuilddir/*.qcow2 output/
cp -av src/busybox/busybox.tar.gz output/
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: oVirtTinyCoreLinux
if-no-files-found: error
path: |
output/*
- name: Run tests
run: ./test.sh
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: ScreenShot
if-no-files-found: error
path: |
oVirtTinyCore.png
release:
name: Release
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: oVirtTinyCoreLinux
path: dist/
- name: Create release
run: gh release create "${GITHUB_REF##*/}" --generate-notes ./dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}