forked from rancher-sandbox/rancher-desktop-opensuse
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (67 loc) · 2.31 KB
/
build.yaml
File metadata and controls
74 lines (67 loc) · 2.31 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
69
70
71
72
73
74
name: Build
on:
push:
branches: [ '**' ]
tags-ignore: [ 'v*', 'test-v*' ]
pull_request:
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- type: tar.xz
arch: amd64
runs-on: ubuntu-latest
- type: tar.xz
arch: arm64
runs-on: ubuntu-24.04-arm
- type: qcow2
arch: amd64
runs-on: ubuntu-latest
- type: qcow2
arch: arm64
runs-on: ubuntu-24.04-arm
env:
GO: /bin/false # Never used, but disable auto-detection in the Makefile.
GOOS: linux
GOARCH: ${{ matrix.arch }}
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
with:
driver-opts: network=host
buildkitd-flags: "--allow-insecure-entitlement security.insecure"
platforms: linux/${{ matrix.arch }}
- name: Restore Docker layer cache
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ runner.temp }}/cache
key: ${{ runner.arch }}-buildx-${{ matrix.type }}-${{ github.sha }}
restore-keys: |
${{ runner.arch }}-buildx-${{ matrix.type }}-
${{ runner.arch }}-buildx-
- name: Install wget
run: sudo apt-get update && sudo apt-get install -y wget
- name: Build image
run: |
echo "Building distro.${{ matrix.type }} for ${{ matrix.arch }}"
make GOARCH=${{ matrix.arch }} distro.${{ matrix.type }}
- name: Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: distro-${{ matrix.type }}-${{ matrix.arch }}
path: distro.${{ matrix.type }}
- name: Save Docker layer cache
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ runner.temp }}/cache
key: ${{ runner.arch }}-buildx-${{ matrix.type }}-${{ github.sha }}