-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (115 loc) · 4.33 KB
/
build.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Build and publish image to ghcr.io/epics-containers
on:
push:
pull_request:
jobs:
build:
# pull requests are a duplicate of a branch push if within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
epics-target: [RTEMS-beatnik, linux-x86_64] # , linux-aarch64]
include:
- os: ubuntu-latest # everyone is on os-latest
- epics-target: RTEMS-beatnik
epics-host: linux-x86_64
extension: -rtems-beatnik
platform: linux/amd64
runtime: "RUNTIME=ghcr.io/epics-containers/rtems-proxy:0.1.6"
- epics-target: linux-x86_64
epics-host: linux-x86_64
extension: ""
platform: linux/amd64
runtime: ""
# - epics-target: linux-aarch64
# epics-host: linux-aarch64
# # a temporary name until multi-arch is supported
# extension: -native-aarch64
# platform: linux/arm64
runs-on: ${{ matrix.os }}
env:
TAG: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}${{ matrix.extension }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
target: runtime
build-args: |
EPICS_TARGET_ARCH=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
IMAGE_EXT=${{ matrix.extension }}
${{ matrix.runtime }}
cache-from: type=gha,scope=${{ matrix.epics-target }}-${{ matrix.target }}
cache-to: type=gha,mode=max,scope=${{ matrix.epics-target }}-${{ matrix.target }}
tags: ci_test
load: true
- name: Test image
# can't test non native without some hardware to run on
if: ${{ matrix.runtime == '' }}
run: tests/run-tests.sh ci_test
- name: Push developer image
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
target: developer
build-args: |
EPICS_TARGET_ARCH=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
IMAGE_EXT=${{ matrix.extension }}
${{ matrix.runtime }}
tags: ${{ env.TAG }}-developer:${{ github.ref_name }}
push: true
- name: Push runtime image
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
target: runtime
build-args: |
EPICS_TARGET_ARCH=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
IMAGE_EXT=${{ matrix.extension }}
${{ matrix.runtime }}
tags: ${{ env.TAG }}-runtime:${{ github.ref_name }}
push: true
release:
# Release on tag push - publish ioc schema
needs: [build]
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
runs-on: ubuntu-latest
# this job runs in the native developer container we just made
container:
image: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}-developer:${{ github.ref_name }}
steps:
- name: generate-schema
run: |
ibek ioc generate-schema --output ibek.ioc.schema.json
- name: Github Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: |
ibek.ioc.schema.json
generate_release_notes: true