diff options
| author | ReFil <31960031+ReFil@users.noreply.github.com> | 2023-11-16 07:49:39 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-16 07:49:39 +0000 |
| commit | cdcec22e609688812bf0f5ac303cc9c6970efb23 (patch) | |
| tree | fa4b666fbc83311089a8ebdb0a7aa0c2b405d2fe /.github/workflows/build.yml | |
| parent | 44a42af666dbeee899520b956200137222c8378c (diff) | |
Version compiled FW with automatic macro (#267)
* Version compiled FW with hash
Auto generates a macro to type out version info, local and github compilation now includes commit hash and timestamp in final uf2 files
* Fix local builds
makefile doesn't like the script returning the macro, directed to null for local builds as version.dtsi file accessible
Diffstat (limited to '.github/workflows/build.yml')
| -rw-r--r-- | .github/workflows/build.yml | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35a2fe9..23c3edf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Get version data + id: get_info + run: | + timestamp=$(date +"%Y%m%d%H%M") + commit=$(echo "${{ github.sha }}" | cut -c1-7) + file_prefix=$timestamp-$commit + branch_name=$(echo "${{ github.ref }}" | awk -F'/' '{print $3}' | cut -c1-4) + echo "file_prefix=$file_prefix" >> $GITHUB_OUTPUT + bin/get_version.sh $branch_name $commit - name: Cache west modules uses: actions/cache@v3 env: @@ -42,11 +51,11 @@ jobs: - name: Adv360 Right Kconfig file run: grep -vE '(^#|^$)' build/right/zephyr/.config - name: Rename zmk.uf2 - run: cp build/left/zephyr/zmk.uf2 left.uf2 && cp build/right/zephyr/zmk.uf2 right.uf2 + run: cp build/left/zephyr/zmk.uf2 ${{ steps.get_info.outputs.file_prefix }}-left.uf2 && cp build/right/zephyr/zmk.uf2 ${{ steps.get_info.outputs.file_prefix }}-right.uf2 - name: Archive (Adv360) uses: actions/upload-artifact@v3 with: name: firmware path: | - left.uf2 - right.uf2 + ${{ steps.get_info.outputs.file_prefix }}-left.uf2 + ${{ steps.get_info.outputs.file_prefix }}-right.uf2 |
