Skip to content

Commit

Permalink
fix release action
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelsadok committed May 2, 2023
1 parent e37a25f commit a308314
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .github/actions/upload-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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).'
Expand Down Expand Up @@ -95,6 +95,7 @@ runs:
shell: python
run: |
import asyncio
import re
import sys
import aiohttp
Expand All @@ -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 }}':
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/firmware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit a308314

Please sign in to comment.