Skip to content

Commit

Permalink
Merge pull request #577 from blckmn/release-process
Browse files Browse the repository at this point in the history
Automated release build process as per configurator
  • Loading branch information
blckmn authored Jun 14, 2022
2 parents 192519a + 7d173fc commit 73b9bf8
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 8 deletions.
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

0 comments on commit 73b9bf8

Please sign in to comment.