This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (88 loc) · 2.97 KB
/
ci.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
---
name: CI
on:
pull_request:
push:
branches:
- main
schedule:
# Run at 06:10 on Sunday
- cron: "10 6 * * 0"
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- amd64
- arm64
steps:
- name: Install the fish shell
uses: fish-actions/install-fish@v1.1.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Configure Podman and Buildah to use FUSE
run: |
sudo apt-get install fuse-overlayfs
mkdir -vp ~/.config/containers
printf '[storage]\ndriver="overlay"\n\n[storage.options]\nmount_program="/usr/bin/fuse-overlayfs"\n' > ~/.config/containers/storage.conf
- name: Check out the repository
uses: actions/checkout@v2
- name: Build the image with Buildah
run: buildah unshare ./build.fish --architecture ${{ matrix.arch }} --name can-utils-${{ matrix.arch }}
- name: Export the image
run: podman image save --format oci-archive -o can-utils-${{ matrix.arch }}.tar localhost/can-utils-${{ matrix.arch }}
- uses: actions/upload-artifact@v2
with:
name: can-utils-${{ matrix.arch }}
path: can-utils-${{ matrix.arch }}.tar
test:
name: Test
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
arch:
- amd64
- arm64
steps:
- name: Install the fish shell
uses: fish-actions/install-fish@v1.1.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Check out the repository
uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: can-utils-${{ matrix.arch }}
- name: Load the image
run: podman image load -i can-utils-${{ matrix.arch }}.tar
- name: Test the container
run: ./test.fish --name can-utils-${{ matrix.arch }}
publish:
name: Publish
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
- name: Create a manifest
run: buildah manifest create can-utils:latest
# aarch64
- uses: actions/download-artifact@v2
with:
name: can-utils-arm64
- name: Load the aarch64 image
run: podman image load -i can-utils-arm64.tar
- name: Add the aarch64 image to the manifest
run: buildah manifest add can-utils:latest localhost/can-utils-arm64
# x86_64
- uses: actions/download-artifact@v2
with:
name: can-utils-amd64
- name: Load the x86_64 image
run: podman image load -i can-utils-amd64.tar
- name: Add the x86_64 image to the manifest
run: buildah manifest add can-utils:latest localhost/can-utils-amd64
- name: Push latest manifest and images to quay.io
run: buildah manifest push --rm --all --creds jwillikers+publisher:${{ secrets.REGISTRY_PASSWORD }} can-utils:latest docker://quay.io/jwillikers/can-utils