mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
* Add action to update development release tag before re-releasing. * Update actions messages.
128 lines
3.0 KiB
YAML
128 lines
3.0 KiB
YAML
name: 'Building Firmware 🔥'
|
|
|
|
on:
|
|
create:
|
|
branches:
|
|
- "!**"
|
|
tags:
|
|
- 'v*.*.*'
|
|
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
paths:
|
|
- 'src/**'
|
|
- '.github/workflows/*.yml'
|
|
- '!**/README.md'
|
|
|
|
pull_request:
|
|
branches:
|
|
- 'master'
|
|
paths:
|
|
- 'src/**'
|
|
- '.github/workflows/*.yml'
|
|
- '!**/README.md'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
target: [OPENMV2, OPENMV3, OPENMV4, OPENMV4P, PORTENTA, OPENMVPT, NICLAV, NANO33, ARDUINO_NANO_RP2040_CONNECT]
|
|
steps:
|
|
- name: '⏳ Checkout repository'
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: false
|
|
|
|
- name: '🧱 Update submodules'
|
|
run: source tools/ci.sh && ci_update_submodules
|
|
|
|
- name: '🛠 Install toolchain '
|
|
run: source tools/ci.sh && ci_install_arm_gcc
|
|
|
|
- name: '🏗 Build firmware'
|
|
run: source tools/ci.sh && ci_build_target ${{ matrix.target }}
|
|
|
|
- name: '⬆ Upload artifacts'
|
|
if: github.event_name != 'pull_request'
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: firmware
|
|
path: firmware
|
|
if-no-files-found: error
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-20.04
|
|
if: github.event_name == 'create'
|
|
steps:
|
|
- name: '⏳ Checkout repository'
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: false
|
|
|
|
- name: '🤌 Download artifacts'
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: firmware
|
|
path: firmware
|
|
|
|
- name: '📦 Package firmware'
|
|
run: source tools/ci.sh && ci_package_firmware_release ${{github.ref_name}}
|
|
|
|
- name: '🔥 Create production release'
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: true
|
|
files: firmware_*.zip
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: '🧹 Remove artifacts'
|
|
uses: geekyeggo/delete-artifact@v1
|
|
with:
|
|
name: firmware
|
|
failOnError: false
|
|
|
|
development:
|
|
needs: build
|
|
runs-on: ubuntu-20.04
|
|
if: github.event_name == 'push'
|
|
steps:
|
|
- name: '⏳ Checkout repository'
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: false
|
|
|
|
- name: '🤌 Download artifacts'
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: firmware
|
|
path: firmware
|
|
|
|
- name: '📦 Package firmware'
|
|
run: source tools/ci.sh && ci_package_firmware_development
|
|
|
|
- name: '🏷 Update development tag'
|
|
uses: EndBug/latest-tag@latest
|
|
with:
|
|
tag-name: development
|
|
|
|
- name: '🔥 Create development release'
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: false
|
|
name: Development Release
|
|
tag_name: development
|
|
body: 'WARNING: This a development release and it may be unstable.'
|
|
files: firmware/firmware_*.zip
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: '🧹 Remove artifacts'
|
|
uses: geekyeggo/delete-artifact@v1
|
|
with:
|
|
name: firmware
|
|
failOnError: false
|