-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (79 loc) · 2.62 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
---
name: CI
on:
workflow_dispatch:
push:
branches: [main]
tags:
- 'v*.*.*'
pull_request:
branches: [main]
env:
REGISTRY: ghcr.io
IMAGE_BASE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build package metadata
id: package_meta
uses: docker/metadata-action@v4
with:
images: foo/bar
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Get package version
id: package
run: |
echo "PACKAGE_VERSION=${{ fromJSON(steps.package_meta.outputs.json).labels['org.opencontainers.image.version'] }}" >> $GITHUB_ENV
- name: Flatc build targets
uses: addnab/docker-run-action@v3
with:
registry: ${{ env.REGISTRY }}
image: ${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}-flatc-builder:main
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: |
--volume ${{ github.workspace }}:/work
--env PACKAGE_VERSION=${{ env.PACKAGE_VERSION }}
run: |
cd work; make fbs
- name: Python build targets
uses: addnab/docker-run-action@v3
with:
registry: ${{ env.REGISTRY }}
image: ${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}-python-builder:main
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: |
--volume ${{ github.workspace }}:/work
--env PACKAGE_VERSION=${{ env.PACKAGE_VERSION }}
run: |
cd work
make python
make msgpack
- name: Package
uses: addnab/docker-run-action@v3
with:
registry: ${{ env.REGISTRY }}
image: ${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}-python-builder:main
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: |
--volume ${{ github.workspace }}:/work
--env PACKAGE_VERSION=${{ env.PACKAGE_VERSION }}
run: |
cd work
make dist_package
ls -1sh ./dist/*.*
ls -1sh ./dist/python/dist/*.*
- name: Publish
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dist/automotive-bus-schema.tar.gz
dist/python/dist/automotive_bus_schema-${{ env.PACKAGE_VERSION }}-py3-none-any.whl