This repository was archived by the owner on May 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
91 lines (91 loc) · 4.66 KB
/
Copy pathbuild.yml
File metadata and controls
91 lines (91 loc) · 4.66 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: build podman
on:
push:
tags:
- build*
jobs:
build-podman:
runs-on: ubuntu-20.04
strategy:
matrix:
config: [ centos7, centos8 ]
steps:
- name: Run actions/checkout for this repo
uses: actions/checkout@v2
with:
path: checkout_build_podman
persist-credentials: false
- name: read config JSON file
id: read-config
run: |
json="$(cat checkout_build_podman/config/${{ matrix.config }}.json)"
json="${json//'%'/'%25'}"
json="${json//$'\r'/'%0D'}"
json="${json//$'\n'/'%0A'}"
echo ::set-output "name=config::$json"
- name: Run actions/setup-go with go version ${{ fromJson(steps.read-config.outputs.config).go_version }}
uses: actions/setup-go@v2
with:
go-version: ${{ fromJson(steps.read-config.outputs.config).go_version }}
- name: mkdir
run: |
mkdir $GITHUB_WORKSPACE/output
mkdir -p $GITHUB_WORKSPACE/gopath/src/github.com/containers
- name: Run actions/checkout for containers/conmon
uses: actions/checkout@v2
with:
repository: ${{ fromJson(steps.read-config.outputs.config).gitrepos.conmon.repository }}
ref: ${{ fromJson(steps.read-config.outputs.config).gitrepos.conmon.ref }}
path: gopath/src/github.com/containers/conmon
persist-credentials: false
- name: Run actions/checkout for containers/podman
uses: actions/checkout@v2
with:
repository: ${{ fromJson(steps.read-config.outputs.config).gitrepos.podman.repository }}
ref: ${{ fromJson(steps.read-config.outputs.config).gitrepos.podman.ref }}
path: gopath/src/github.com/containers/podman
persist-credentials: false
# Podman issue 9389 has already been fixed in the Podman master branch
# (see https://github.com/containers/podman/issues/9389)
# Remove this workaround later
- name: Fix Podman issue 9389
run: |
bash checkout_build_podman/fix_podman_issue_9389.bash
- name: Run actions/checkout for CNI/plugins
uses: actions/checkout@v2
with:
repository: ${{ fromJson(steps.read-config.outputs.config).gitrepos.CNI-plugins.repository }}
ref: ${{ fromJson(steps.read-config.outputs.config).gitrepos.CNI-plugins.ref }}
path: gopath/src/github.com/containernetworking/plugins
persist-credentials: false
- name: check podman version
run: |
podman --version
- name: podman build
run: |
bash checkout_build_podman/build_containerimage.bash ${{ matrix.config }}
- name: podman run
run: |
bash checkout_build_podman/build_podman_wrapper.bash ${{ matrix.config }}
- name: check output
run: |
ls $GITHUB_WORKSPACE/output
- name: download extra executables
run: |
curl -o output/bin/crun -L -s https://github.com/containers/crun/releases/download/${{ fromJson(steps.read-config.outputs.config).download.crun }}/crun-${{ fromJson(steps.read-config.outputs.config).download.crun }}-linux-amd64
chmod 755 output/bin/crun
curl -o output/bin/slirp4netns -L -s https://github.com/rootless-containers/slirp4netns/releases/download/${{ fromJson(steps.read-config.outputs.config).download.slirp4netns }}/slirp4netns-x86_64
chmod 755 output/bin/slirp4netns
curl -o output/bin/fuse-overlayfs -L -s https://github.com/containers/fuse-overlayfs/releases/download/${{ fromJson(steps.read-config.outputs.config).download.fuse-overlayfs }}/fuse-overlayfs-x86_64
chmod 755 output/bin/fuse-overlayfs
- name: set name
id: setname
run: echo ::set-output name=outputname::build-podman_${{ github.sha }}__${{ matrix.config }}__${{ fromJson(steps.read-config.outputs.config).gitrepos.podman.ref }}__${{ fromJson(steps.read-config.outputs.config).gitrepos.conmon.ref }}__${{ fromJson(steps.read-config.outputs.config).gitrepos.CNI-plugins.ref }}__${{ fromJson(steps.read-config.outputs.config).go_version }}__${{ fromJson(steps.read-config.outputs.config).download.crun }}__${{ fromJson(steps.read-config.outputs.config).download.slirp4netns }}__${{ fromJson(steps.read-config.outputs.config).download.fuse-overlayfs }}
- name: create tar archive
run: |
mv output ${{steps.setname.outputs.outputname}}
tar --force-local -cvf ${{steps.setname.outputs.outputname}}.tar ${{steps.setname.outputs.outputname}}
- uses: actions/upload-artifact@v2
with:
name: ${{steps.setname.outputs.outputname}}.tar
path: ${{steps.setname.outputs.outputname}}.tar