forked from siderolabs/talos
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (114 loc) · 4.46 KB
/
ci.yaml
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
name: Talos Image
on:
push:
branches: [ 'release-*' ]
tags:
- "v*"
env:
ORIGIN_REPO: siderolabs/talos
ORIGIN_TAG: v1.8.3
KERNEL_TAG: v1.8.3
SBC_TAG: v1.8.3
RK3588_TAG: v1.8.3
jobs:
talos-build:
#runs-on: buildjet-4vcpu-ubuntu-2204-arm
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
issues: read
packages: write
pull-requests: read
steps:
- uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ env.ORIGIN_REPO }}
ref: ${{ env.ORIGIN_TAG }}
# need history for `git describe` to work for Talos `Makefile`
fetch-depth: 0
fetch-tags: true
- name: Set Environment Variable
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "PUBLISH_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
echo "PUBLISH_TAG=${ORIGIN_TAG#*/}-${GITHUB_SHA::10}" >> $GITHUB_ENV
fi
shell: bash
- name: Build and push Talos installer image
run: make installer
env:
PUSH: '1'
TAG: ${{ env.PUBLISH_TAG }}
TAG_SUFFIX: "-nosbclayer"
PKG_KERNEL: ghcr.io/nberlee/kernel:${{ env.KERNEL_TAG }}
USERNAME: ${{ github.actor }}
PLATFORM: linux/arm64
PROGRESS: plain
CI_ARGS: "--cache-from=ghcr.io/${{ github.actor }}/installer:cache --cache-to=ghcr.io/${{ github.actor }}/installer:cache"
- name: Build and push Talos imager image
run: make imager
env:
PUSH: '1'
TAG: ${{ env.PUBLISH_TAG }}
PKG_KERNEL: ghcr.io/nberlee/kernel:${{ env.KERNEL_TAG }}
USERNAME: ${{ github.actor }}
PLATFORM: linux/arm64,linux/amd64
INSTALLER_ARCH: arm64
PROGRESS: plain
CI_ARGS: "--cache-from=ghcr.io/${{ github.actor }}/imager:cache --cache-to=ghcr.io/${{ github.actor }}/imager:cache"
- name: release-notes
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir -p _out
# Hack for ARM64 release tool
mv hack/release.sh hack/release.sh.old
curl -sL "https://raw.githubusercontent.com/nberlee/talos/release-1.8-turingrk1/hack/release.sh" -o hack/release.sh
chmod +x hack/release.sh
export TAG=${GITHUB_REF#refs/tags/}
make release-notes
mv hack/release.sh.old hack/release.sh
- name: Build an turing-rk1 flashable image
run: |
make image-metal
sudo zstd -d _out/metal-arm64.raw.zst
sudo xz _out/metal-arm64.raw
env:
USERNAME: ${{ github.actor }}
TAG: ${{ env.PUBLISH_TAG }}
PLATFORM: linux/arm64
PROGRESS: plain
IMAGER_ARGS: "--base-installer-image ghcr.io/nberlee/installer:${{ env.PUBLISH_TAG }}-nosbclayer --system-extension-image ghcr.io/nberlee/rk3588:${{ env.RK3588_TAG }} --overlay-image ghcr.io/nberlee/sbc-turingrk1:${{ env.SBC_TAG }} --overlay-name=turingrk1"
- name: Build an turing-rk1 installer
run: |
make image-installer
curl -sL "https://github.com/google/go-containerregistry/releases/download/v0.20.2/go-containerregistry_$(uname -s)_$(uname -m).tar.gz" | tar -zxv -C /usr/local/bin/ crane
crane push _out/installer-arm64.tar ghcr.io/nberlee/installer:${{ env.PUBLISH_TAG }}-rk3588
env:
USERNAME: ${{ github.actor }}
TAG: ${{ env.PUBLISH_TAG }}
PLATFORM: linux/arm64
PROGRESS: plain
IMAGER_ARGS: "--base-installer-image ghcr.io/nberlee/installer:${{ env.PUBLISH_TAG }}-nosbclayer --system-extension-image ghcr.io/nberlee/rk3588:${{ env.RK3588_TAG }} --overlay-image ghcr.io/nberlee/sbc-turingrk1:${{ env.SBC_TAG }} --overlay-name=turingrk1"
- uses: actions/upload-artifact@v3
with:
name: image-turing-rk1
path: _out/*.raw.xz
if-no-files-found: error
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: crazy-max/ghaction-github-release@v2
with:
body_path: _out/RELEASE_NOTES.md
draft: "true"
files: |
_out/metal-arm64.raw.*