From a308314ed2ca613164b81e7bbdfacc53cd1859ff Mon Sep 17 00:00:00 2001 From: Samuel Sadok Date: Tue, 2 May 2023 11:47:09 +0200 Subject: [PATCH] fix release action --- .github/actions/upload-release/action.yml | 9 +++++---- .github/workflows/firmware.yaml | 10 +++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/actions/upload-release/action.yml b/.github/actions/upload-release/action.yml index a84d306d1..3a32de321 100644 --- a/.github/actions/upload-release/action.yml +++ b/.github/actions/upload-release/action.yml @@ -23,8 +23,8 @@ inputs: odrive_api_key: description: 'Key to our release index server' required: true - product: - description: 'ODrive product name (for firmware releases only).' + board: + description: 'ODrive board version triplet ("PRODUCT_LINE.VERSION.VARIANT") (for firmware releases only).' required: false app: description: 'Firmware app name (default, bootloader) (for firmware releases only).' @@ -95,6 +95,7 @@ runs: shell: python run: | import asyncio + import re import sys import aiohttp @@ -115,8 +116,8 @@ runs: release_api = PrivateReleaseApi(api_client) qualifiers = {} - if '${{ inputs.product }}': - qualifiers['product'] = '${{ inputs.product }}' + if '${{ inputs.board }}': + qualifiers['board'] = tuple(int(i) for i in re.match(r'^([0-9]+)\.([0-9]+).([0-9]+)$', '${{ inputs.board }}').groups()) if '${{ inputs.app }}': qualifiers['app'] = '${{ inputs.app }}' if '${{ inputs.variant }}': diff --git a/.github/workflows/firmware.yaml b/.github/workflows/firmware.yaml index 90f3e4002..5f73efd65 100644 --- a/.github/workflows/firmware.yaml +++ b/.github/workflows/firmware.yaml @@ -147,6 +147,14 @@ jobs: mkdir ${{ github.workspace }}/out cp ${{ github.workspace }}/Firmware/build/ODriveFirmware.elf ${{ github.workspace }}/out/firmware.elf + - name: Parse and format matrix.board_version + if: ${{ matrix.os == 'ubuntu-latest' }} + id: format-board-version + run: | + formatted_version=$(echo "${{ matrix.board_version }}" | sed 's/v\([0-9]\+\)\.\([0-9]\+\)-\([0-9]\+\)V/\1.\2.\3/') + echo "Formatted board version: $formatted_version" + echo "::set-output name=formatted_board_version::$formatted_version" + - name: Upload firmware to ODrive release system 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-')) }} uses: ./.github/actions/upload-release @@ -157,7 +165,7 @@ jobs: do_access_key: ${{ secrets.DIGITALOCEAN_ACCESS_KEY }} do_secret_key: ${{ secrets.DIGITALOCEAN_SECRET_KEY }} odrive_api_key: ${{ secrets.ODRIVE_API_KEY }} - product: ODrive ${{ matrix.board_version }} + board: ${{ steps.format-board-version.outputs.formatted_board_version }} app: default variant: public