forked from vexxhost/capo-image-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 2.02 KB
/
ci.yaml
File metadata and controls
68 lines (56 loc) · 2.02 KB
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
name: ci
on: [push]
jobs:
build:
runs-on: ubuntu-24.04
permissions:
contents: write
strategy:
matrix:
os:
- ubuntu/noble
version:
- 1.31.1
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv sync
- run: sudo apt update && sudo apt install -y $(uv run bindep -b)
- uses: winterjung/split@7f51d99e7cc1f147f6f99be75acf5e641930af88 # v2.1.0
id: split
with:
msg: ${{ matrix.os }}
separator: "/"
- name: Create .cache directory so it doesn't get created with incorrect ownership
run: mkdir -p ~/.cache
if: ${{ steps.split.outputs._0 == 'ubuntu' }}
- name: Set image filename env var
run: echo "IMAGE_NAME=${{ steps.split.outputs._0 }}-${{ steps.split.outputs._1 }}-${{ matrix.version }}" >> "$GITHUB_ENV"
- uses: actions/cache@v4
with:
path: /home/runner/.cache/image-create
key: ${{ env.IMAGE_NAME }}-${{ github.head_ref || github.ref_name }}
restore-keys: |
${{ env.IMAGE_NAME }}-${{ github.head_ref || github.ref_name }}
${{ env.IMAGE_NAME }}
${{ steps.split.outputs._0 }}-${{ steps.split.outputs._1 }}
- run: uv run disk-image-create -o "${IMAGE_NAME}.qcow2" vm block-device-efi ${{ steps.split.outputs._0 }} kubernetes
env:
ELEMENTS_PATH: ${{ github.workspace }}/elements
DIB_RELEASE: ${{ steps.split.outputs._1 }}
DIB_KUBERNETES_VERSION: ${{ matrix.version }}
DIB_MIN_TMPFS: "4"
- name: Publish artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.IMAGE_NAME }}
path: ${{ env.IMAGE_NAME }}.qcow2
if-no-files-found: error
retention-days: 7
- name: Upload image to release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
files: ${{ env.IMAGE_NAME }}.qcow2