Skip to content

Commit

Permalink
update workflow for release
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelsadok committed Aug 11, 2022
1 parent 67a6424 commit dc26156
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/actions/add-version-to-channel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ inputs:
runs:
using: "composite"
steps:
- name: Install Prerequisites
shell: bash
run: |
pip install aiohttp cryptography
pip install odrive --pre
- name: Register on release server
shell: python
run: |
Expand Down
60 changes: 59 additions & 1 deletion .github/workflows/firmware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,29 @@ jobs:
- {os: ubuntu-latest, board_version: v3.6-56V, debug: false}

runs-on: ${{ matrix.os }}
outputs:
channel: ${{ steps.release-info.outputs.channel }}
version: ${{ steps.release-info.outputs.version }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch entire history to get version information

- name: Get release name and channel
id: release-info
shell: python
run: |
if "${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/fw-v0.5.') }}" == "true":
channel = "master"
version = "${{ github.ref }}"[len("refs/tags/fw-v"):]
else:
channel = "none"
version = "${{ github.sha }}"
print("::set-output name=channel::" + channel)
print("::set-output name=version::" + version)
- name: Install prerequisites (Debian)
if: startsWith(matrix.os, 'ubuntu-')
run: |
Expand Down Expand Up @@ -114,7 +132,7 @@ jobs:
mv tup_build.sh tup_build.bat # in reality this is a .bat script on windows
.\tup_build.bat
- name: Upload binary
- name: Upload binary as artifact
if: ${{ matrix.os == 'ubuntu-latest' && matrix.debug == false }}
uses: actions/upload-artifact@v2
with:
Expand All @@ -124,6 +142,46 @@ jobs:
Firmware/build/ODriveFirmware.bin
Firmware/build/ODriveFirmware.hex
- name: Copy firmware to temp folder
run: |
mkdir ${{ github.workspace }}/out
cp ${{ github.workspace }}/Firmware/build/ODriveFirmware.elf ${{ github.workspace }}/out/firmware.elf
- 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
with:
release_type: firmware
version: ${{ steps.release-info.outputs.version }}
src_dir: out
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 }}
app: default
variant: public

make-release:
needs: [compile] # require all builds to succeed before we actually make the release
if: needs.compile.outputs.channel == 'master'
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v2

- name: Install Python dependencies
run: pip install aiohttp appdirs

- name: Add version to release channel
uses: ./.github/actions/add-version-to-channel
with:
release_type: firmware
channel: ${{ needs.compile.outputs.channel }}
version: ${{ needs.compile.outputs.version }}
odrive_api_key: ${{ secrets.ODRIVE_API_KEY }}

code-checks:
strategy:
fail-fast: false
Expand Down

0 comments on commit dc26156

Please sign in to comment.