Skip to content

Commit

Permalink
use gh-describe
Browse files Browse the repository at this point in the history
  • Loading branch information
mossmann committed May 20, 2024
1 parent dab8897 commit 917d048
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/firmware.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Firmware
on: [push, pull_request, merge_group]

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
firmware-build:
runs-on: ubuntu-latest
Expand All @@ -18,20 +15,28 @@ jobs:
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1

- name: Git describe
id: ghd
uses: proudust/gh-describe@v2

- name: Check outputs
run: |
echo "describe : ${{ steps.ghd.outputs.describe }}"
echo "tag : ${{ steps.ghd.outputs.tag }}"
echo "distance : ${{ steps.ghd.outputs.distance }}"
echo "sha : ${{ steps.ghd.outputs.sha }}"
echo "short-sha : ${{ steps.ghd.outputs.short-sha }}"
git describe --abbrev=7 --dirty --always --tags
- name: Checkout source code
uses: actions/checkout@v4
with:
submodules: true

- name: Build Apollo firmware for ${{ matrix.target-board }}
run: |
# fetch to enable `git describe` used for firmware version string
TAG=$(git ls-remote origin "refs/tags/*[0-9]" | cut -f 2- | sort -V | tail -1)
[ -n "$TAG" ] && git fetch --filter=tree:0 --shallow-exclude $TAG origin $BRANCH_NAME
[ -n "$TAG" ] && git fetch --filter=tree:0 --deepen=1 origin $BRANCH_NAME
[ -n "$TAG" ] && git fetch --filter=tree:0 --depth=1 origin $TAG:$TAG
cd firmware
APOLLO_BOARD=${{ matrix.target-board }} make get-deps all
APOLLO_BOARD=${{ matrix.target-board }} VERSION_STRING=${{ describe }} make get-deps all
# Publish bootloader binary for latest Cynthion hardware revision
- name: Publish Artifacts
Expand Down

0 comments on commit 917d048

Please sign in to comment.