-
-
Notifications
You must be signed in to change notification settings - Fork 105
86 lines (80 loc) · 2.22 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
name: Build
on:
workflow_call:
inputs:
firmware-retention-days:
required: true
type: number
build-type:
default: "release"
type: string
build-tag:
default: "dev"
type: string
branch:
required: false
type: string
workflow_dispatch:
inputs:
firmware-retention-days:
type: choice
description: How long to save artifacts
options:
- 5
- 30
build-type:
type: choice
description: Build type
options:
- Debug
- Release
- Relwithdebinfo
build-tag:
type: choice
description: Tag for firmware version
options:
- dev
- nightly
- beta
permissions:
contents: write #required to update release tags
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout branch
if: inputs.branch != null
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Checkout branch
if: inputs.branch == null
uses: actions/checkout@v4
- name: Validate Build Type
run: buildtype=${{inputs.build-type }} node .github/scripts/validate_build_string.js
- name: Fetch container image
run: |
docker pull ghcr.io/synthstromaudible/dbt-toolchain:v$(cat toolchain/REQUIRED_VERSION)
- name: Run build
run: |
docker run --rm \
--user=$(id --user):$(id --group) \
-e DBT_NO_PYTHON_UPGRADE=1 \
-v $(pwd):/src \
ghcr.io/synthstromaudible/dbt-toolchain:v$(cat toolchain/REQUIRED_VERSION) \
build \
--verbose \
--tag-metadata \
--type ${{ inputs.build-tag }} \
${{ inputs.build-type }}
- name: Genfile check
run: |
git diff --exit-code
- name: Publish built firmware (release-bin)
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.build-tag }}_${{ inputs.build-type }}_build_bundle
path: build/${{ inputs.build-type }}/*
if-no-files-found: error
retention-days: ${{ inputs.firmware-retention-days }}