Build #1002
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |