This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
187 lines (159 loc) · 4.81 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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: build
on:
workflow_dispatch:
push:
branches:
- "**"
pull_request:
branches:
- main
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
cache: true
go-version: stable
- name: Install Task
run: go install github.com/go-task/task/v3/cmd/task@latest
- name: Install
run: sudo apt-get install -y genisoimage
- name: Register Subscriptions
run: task register-subscription
env:
REDHAT_ORG: ${{ secrets.REDHAT_ORG }}
REDHAT_ACTIVATION_KEY: ${{ secrets.REDHAT_ACTIVATION_KEY }}
- name: Build and Extract ISO
run: task extract
- name: Unregister Subscriptions
run: task register-subscription
if: always()
- name: Mount ISO
run: |
echo "--> Prepare ISO"
sudo mkdir /mnt/virtio-iso
sudo chown $USER:$USER /mnt/virtio-iso
sudo chmod 755 /mnt/virtio-iso
echo "--> Mounting ISO"
sudo mount -o loop build/virtio-win.iso /mnt/virtio-iso
- name: Copy files and generate Win-PE ISOs
run: ./scripts/ci-copy-files.sh /mnt/virtio-iso
- name: Upload virtio-win.iso
uses: actions/upload-artifact@v3
with:
name: virtio-win.iso
path: build/virtio-win.iso
retention-days: 7
- name: Upload virtio-win.iso checksum
uses: actions/upload-artifact@v3
with:
name: virtio-win.iso.sha256
path: build/virtio-win.iso.sha256
retention-days: 7
- name: Upload virtio-win-guest-tools.exe
uses: actions/upload-artifact@v3
with:
name: virtio-win-guest-tools.exe
path: docker/build/virtio-win-guest-tools.exe
retention-days: 7
- name: Upload virtio-win-guest-tools.exe checksum
uses: actions/upload-artifact@v3
with:
name: virtio-win-guest-tools.exe.sha256
path: docker/build/virtio-win-guest-tools.exe.sha256
retention-days: 7
- name: Upload virtio-winpe.iso
uses: actions/upload-artifact@v3
with:
name: virtio-winpe.iso
path: docker/build/virtio-winpe.iso
retention-days: 7
- name: Upload virtio-winpe.iso checksum
uses: actions/upload-artifact@v3
with:
name: virtio-winpe.iso.sha256
path: docker/build/virtio-winpe.iso.sha256
retention-days: 7
- name: Upload VERSION.txt
uses: actions/upload-artifact@v3
with:
name: VERSION.txt
path: docker/build/VERSION.txt
retention-days: 7
- name: Files
run: |
tree -p docker/build/
cat docker/build/VERSION.txt
verify:
runs-on: windows-latest
defaults:
run:
shell: powershell
needs:
- build
steps:
- uses: actions/checkout@v4
- name: Download VIRTIO ISO
uses: actions/download-artifact@v3
with:
name: virtio-win.iso
- name: Verify
run: .\scripts\verify.ps1 -Path ${env:GITHUB_WORKSPACE}\virtio-win.iso
# Release if
# 1. Latest tag on GitHub differs from extracted version
# 2. If on master branch
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
permissions:
contents: write
needs:
- build
- verify
steps:
- uses: actions/checkout@v4
- name: Download ISO
uses: actions/download-artifact@v3
with:
path: docker/build/
name: virtio-win.iso
- name: Download ISO checksum
uses: actions/download-artifact@v3
with:
path: docker/build/
name: virtio-win.iso.sha256
- name: Download winpe ISO
uses: actions/download-artifact@v3
with:
path: docker/build/
name: virtio-winpe.iso
- name: Download winpe ISO checksum
uses: actions/download-artifact@v3
with:
path: docker/build/
name: virtio-winpe.iso.sha256
- name: Download virtio-win-guest-tools.exe
uses: actions/download-artifact@v3
with:
path: docker/build/
name: virtio-win-guest-tools.exe
- name: Download virtio-win-guest-tools.exe checksum
uses: actions/download-artifact@v3
with:
path: docker/build/
name: virtio-win-guest-tools.exe.sha256
- name: Download VERSION.txt
uses: actions/download-artifact@v3
with:
path: docker/build/
name: VERSION.txt
- name: Release if necessary
run: |
ls -alh docker/build
./scripts/ci-release.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}