Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## This is triggered by the publishing of a release, and will build the assets and attach them.

name: On Release

on:
release:
types: [published]

jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
with:
debug_build: false

release:
name: Attach Release Artifacts
needs: ci
runs-on: ubuntu-22.04
steps:
- name: Code Checkout
uses: actions/checkout@v2

- name: Fetch build artifacts
uses: actions/download-artifact@v2

- name: List assets
run: ls -al Betaflight-*/*

- name: Attach assets to release
run: |
set -x
assets=()
for asset in Betaflight-*/*; do
assets+=("-a" "$asset")
echo "$asset"
done
tag_name="${GITHUB_REF##*/}"
hub release edit "${assets[@]}" -m "" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 12 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Builds Betaflight Blackbox Explorer on Windows, Linux and macOS platforms.
#
# After building, artifacts are released to a separate repository.

env:
debugBuild: true
# After building, artifacts are released to a seperate repository.

name: CI

on: workflow_call
on:
workflow_call:
inputs:
debug_build:
description: 'Specifies if it is a debug build or a release build'
default: true
required: false
type: boolean

jobs:
build:
Expand Down Expand Up @@ -45,14 +49,14 @@ jobs:
- run: yarn install --immutable --immutable-cache --check-cache

- run: yarn gulp release ${{ matrix.releaseArgs }}
if: ${{ !env.debugBuild }}
if: ${{ !inputs.debug_build }}

- run: yarn gulp debug-release ${{ matrix.releaseArgs }}
if: ${{ env.debugBuild }}
if: ${{ inputs.debug_build }}

- name: Publish build artifacts
uses: actions/upload-artifact@v2
with:
name: Betaflight-Blackbox-Explorer${{ env.debugBuild == 'true' && '-Debug' || '' }}-${{ matrix.name }}
name: Betaflight-Blackbox-Explorer${{ inputs.debug_build == 'true' && '-Debug' || '' }}-${{ matrix.name }}
path: release/
retention-days: 90