Skip to content

Commit a308314

Browse files
committed
fix release action
1 parent e37a25f commit a308314

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.github/actions/upload-release/action.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ inputs:
2323
odrive_api_key:
2424
description: 'Key to our release index server'
2525
required: true
26-
product:
27-
description: 'ODrive product name (for firmware releases only).'
26+
board:
27+
description: 'ODrive board version triplet ("PRODUCT_LINE.VERSION.VARIANT") (for firmware releases only).'
2828
required: false
2929
app:
3030
description: 'Firmware app name (default, bootloader) (for firmware releases only).'
@@ -95,6 +95,7 @@ runs:
9595
shell: python
9696
run: |
9797
import asyncio
98+
import re
9899
import sys
99100
100101
import aiohttp
@@ -115,8 +116,8 @@ runs:
115116
release_api = PrivateReleaseApi(api_client)
116117
117118
qualifiers = {}
118-
if '${{ inputs.product }}':
119-
qualifiers['product'] = '${{ inputs.product }}'
119+
if '${{ inputs.board }}':
120+
qualifiers['board'] = tuple(int(i) for i in re.match(r'^([0-9]+)\.([0-9]+).([0-9]+)$', '${{ inputs.board }}').groups())
120121
if '${{ inputs.app }}':
121122
qualifiers['app'] = '${{ inputs.app }}'
122123
if '${{ inputs.variant }}':

.github/workflows/firmware.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ jobs:
147147
mkdir ${{ github.workspace }}/out
148148
cp ${{ github.workspace }}/Firmware/build/ODriveFirmware.elf ${{ github.workspace }}/out/firmware.elf
149149
150+
- name: Parse and format matrix.board_version
151+
if: ${{ matrix.os == 'ubuntu-latest' }}
152+
id: format-board-version
153+
run: |
154+
formatted_version=$(echo "${{ matrix.board_version }}" | sed 's/v\([0-9]\+\)\.\([0-9]\+\)-\([0-9]\+\)V/\1.\2.\3/')
155+
echo "Formatted board version: $formatted_version"
156+
echo "::set-output name=formatted_board_version::$formatted_version"
157+
150158
- name: Upload firmware to ODrive release system
151159
if: ${{ steps.release-info.outputs.channel == 'master' && matrix.os == 'ubuntu-latest' && matrix.debug == false && (startsWith(matrix.board_version, 'v3.5-') || startsWith(matrix.board_version, 'v3.6-')) }}
152160
uses: ./.github/actions/upload-release
@@ -157,7 +165,7 @@ jobs:
157165
do_access_key: ${{ secrets.DIGITALOCEAN_ACCESS_KEY }}
158166
do_secret_key: ${{ secrets.DIGITALOCEAN_SECRET_KEY }}
159167
odrive_api_key: ${{ secrets.ODRIVE_API_KEY }}
160-
product: ODrive ${{ matrix.board_version }}
168+
board: ${{ steps.format-board-version.outputs.formatted_board_version }}
161169
app: default
162170
variant: public
163171

0 commit comments

Comments
 (0)