Skip to content

added and aplied precommit #16

added and aplied precommit

added and aplied precommit #16

---
name: Firmware release
on:
workflow_dispatch:
inputs:
name:
description: Version to bump (major, minor, patch)
default: patch
required: true
pull_request:
branches: master
types: [closed]
jobs:
get-bump:
name: Get version bump
runs-on: ubuntu-latest
outputs:
bump: ${{ env.BUMP }}
steps:
- if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
name: Get version bump
id: get-version-bump
uses: husarion-ci/action-get-version-bump@v0.3.0
- if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
run: echo "BUMP=${{ steps.get-version-bump.outputs.bump }}" >> $GITHUB_ENV
- if: github.event_name == 'workflow_dispatch'
run: echo "BUMP=${{ github.event.inputs.name }}" >> $GITHUB_ENV
bump-version:
name: Bump version
runs-on: ubuntu-latest
needs: get-bump
if: needs.get-bump.outputs.bump != 'none'
outputs:
new_version: ${{ steps.bump-semver.outputs.new_version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
with:
with_initial_version: false
semver_only: true
- uses: actions-ecosystem/action-bump-semver@v1
id: bump-semver
with:
current_version: ${{ steps.get-latest-tag.outputs.tag }}
level: ${{ needs.get-bump.outputs.bump }}
- name: Create tag
run: git tag ${{ steps.bump-semver.outputs.new_version }}
- name: Publish tags
run: git push --tags
firmware-release:
name: Firmware release
needs: bump-version
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Installing platformio
run: pip3 install -U platformio
- name: Building a firmware for STM32
run: pio run
- name: Release a firmware
uses: softprops/action-gh-release@v1
with:
files: |
.pio/build/rosbot_xl_digital_board/firmware.bin
LICENSE
tag_name: ${{ needs.bump-version.outputs.new_version }}