v3.4.0 #76
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
tags: | |
- 'v3.*' | |
name: Upload Release Assets | |
env: | |
MAKEOPTS: -j | |
permissions: | |
contents: write | |
jobs: | |
upload_release: | |
name: Upload Release Assets | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install cross-compiler | |
run: sudo apt-get update && sudo apt-get install --yes gcc-arm-none-eabi | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Build firmware | |
run: | | |
make $MAKEOPTS -C micropython/mpy-cross | |
make $MAKEOPTS -C bricks/movehub | |
make $MAKEOPTS -C bricks/cityhub | |
make $MAKEOPTS -C bricks/technichub | |
make $MAKEOPTS -C bricks/primehub | |
make $MAKEOPTS -C bricks/essentialhub | |
- name: Get tag | |
run: echo "GITHUB_TAG=${GITHUB_REF#*refs/tags/}" >> $GITHUB_ENV | |
- name: Create Release and Upload Assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref_name }} | |
run: | | |
if [[ "${{ contains(env.GITHUB_TAG, 'a') || contains(env.GITHUB_TAG, 'b') || contains(env.GITHUB_TAG, 'c') }}" == "true" ]]; then | |
PRERELEASE_FLAG="--prerelease" | |
else | |
PRERELEASE_FLAG="" | |
fi | |
HUBS="movehub cityhub technichub primehub essentialhub" | |
for HUB in $HUBS; do | |
NEW_FILENAME="./bricks/$HUB/build/pybricks-$HUB-${{ env.GITHUB_TAG }}.zip" | |
mv "./bricks/$HUB/build/firmware.zip" "$NEW_FILENAME" | |
ASSETS="$ASSETS $NEW_FILENAME" | |
done | |
gh release create "$tag" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="${tag#v}" \ | |
-F CHANGELOG.md \ | |
$PRERELEASE_FLAG \ | |
$ASSETS |