Skip to content

Commit

Permalink
Merge branch 'master' into modules/moooooooore-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
chmelevskij committed Apr 14, 2022
2 parents 1d316ae + 31aebea commit f353161
Show file tree
Hide file tree
Showing 72 changed files with 7,492 additions and 4,672 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/artifact-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Artifact links comments creator
on:
workflow_run:
workflows: ["PR"]
types: [completed]

jobs:
artifacts-url-comments:
name: Add artifact links to PR and issues
runs-on: ubuntu-20.04
steps:
- name: Add artifact links to PR and issues
uses: tonyhallett/artifacts-url-comments@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
prefix: "Do you want to test this code? Here you have an automated build:"
suffix: "WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!"
format: name
addTo: pullandissues
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-20.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 }}
36 changes: 12 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,21 @@
#
# After building, artifacts are released to a seperate repository.

env:
debugBuild: true

name: CI

on:
push:
branches:
- master
- '*-maintenance'
pull_request:
branches:
- master
- '*-maintenance'
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:
test:
name: Test
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

Expand All @@ -36,13 +31,6 @@ jobs:
- name: Run unit tests
run: yarn test

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@043296c976c53f4536194ebe3841ed720e04d496 # v1.26
if: always()
with:
files: test-results-junit/**/*.xml
comment_mode: 'off'

build:
name: Build (${{ matrix.name }})
needs: test
Expand Down Expand Up @@ -90,14 +78,14 @@ jobs:
- run: yarn install --immutable --immutable-cache --check-cache

- run: yarn gulp release ${{ matrix.releaseArgs }}
if: ${{ !env.debugBuild }}
if: ${{ !inputs.debug_build && matrix.name != 'Android' }}

- run: yarn gulp debug-release ${{ matrix.releaseArgs }}
if: ${{ env.debugBuild }}
if: ${{ inputs.debug_build || matrix.name == 'Android' }}

- name: Publish build artifacts
uses: actions/upload-artifact@v2
with:
name: Betaflight-Configurator${{ env.debugBuild == 'true' && '-Debug' || '' }}-${{ matrix.name }}
name: Betaflight-Configurator${{ inputs.debug_build == 'true' && '-Debug' || '' }}-${{ matrix.name }}
path: release/
retention-days: 10
retention-days: 90
17 changes: 17 additions & 0 deletions .github/workflows/hide-artifact-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Hide artifact links comments

on:
pull_request_target:
types: [synchronize, reopened]

jobs:
hide-artifacts-link-comments:
name: Hide artifact links
runs-on: ubuntu-20.04
steps:
- name: Hide comments
uses: int128/hide-comment-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
starts-with: "Do you want to test this code? Here you have an automated build:"
ends-with: "WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!"
52 changes: 31 additions & 21 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,62 @@
# You'll need to setup the follwing environment variables:
# env.repoNightly - The repository to release nightly builds to e.g. betaflight-configurator-nightly
# env.releaseNotes - The release notes to be published as part of the github release
# env.repo_nightly - The repository to release nightly builds to e.g. betaflight-configurator-nightly
# env.release_notes - The release notes to be published as part of the github release
# env.debug_release_notes - The release notes to be published as part of the github debug release
# secrets.REPO_TOKEN - A GitHub token with permissions to push and publish releases to the nightly repo

env:
repoNightly: betaflight/betaflight-configurator-nightlies
debugReleaseNotes: >
repo_nightly: betaflight/betaflight-configurator-nightlies
debug_release_notes: >
This is an automated development build.
It may be unstable and result in corrupted configurations or data loss.
**Use only for testing.**
releaseNotes: This is a release build. It does not contain the debug console.
release_notes: This is a release build. It does not contain the debug console.

name: Nightly Build
name: Nightly

on:
workflow_run:
workflows: [CI]
types: [completed]
push:
branches:
- master
- '*-maintenance'

jobs:
release-nightly:
name: Release Nightly
ci:
name: CI
uses: ./.github/workflows/ci.yml
with:
debug_build: true

release:
name: Nightly release
needs: ci
runs-on: ubuntu-20.04
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }}
steps:
- name: Fetch release assets
uses: dawidd6/action-download-artifact@09385b76de790122f4da9c82b17bccf858b9557c # v2.16.0
- name: Fetch build artifacts
uses: actions/download-artifact@v2
with:
path: release-assets/
workflow: ${{ github.event.workflow_run.workflow_id }}

- name: Select release notes
id: notes
run: |
set -- release-assets/Betaflight-Configurator-Debug-*
echo "::set-output name=notes::$(test -e "$1" && echo '${{ env.debugReleaseNotes }}' || echo '${{ env.releaseNotes }}')"
echo "::set-output name=notes::$(test -e "$1" && echo '${{ env.debug_release_notes }}' || echo '${{ env.release_notes }}')"
- name: Get current date
id: date
run: echo "::set-output name=today::$(date '+%Y%m%d')"

- name: Release
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v0.1.14
with:
token: ${{ secrets.REPO_TOKEN }}
repository: ${{ env.repoNightly }}
tag_name: build-${{ github.run_number }}
repository: ${{ env.repo_nightly }}
tag_name: v${{ steps.date.outputs.today }}.${{ github.run_number }}
files: release-assets/Betaflight-Configurator-*/**
draft: false
prerelease: false
fail_on_unmatched_files: true
name: '${{ github.repository }}: ${{ github.ref_name }}'
body: |
${{ steps.notes.outputs.notes }}
Expand All @@ -57,7 +67,7 @@ jobs:
${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }}))
### Latest changeset:
${{ github.sha }} ([link](https://github.com/${{ github.repository }}/commit/${{ github.sha }}))
${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }}))
### Changes:
${{ github.event.workflow_run.head_commit.message }}
${{ github.event.head_commit.message }}
12 changes: 12 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: PR

on:
pull_request:
branches:
- master
- '*-maintenance'

jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# You'll need to setup the follwing environment variables:
# secrets.REPO_TOKEN - A GitHub token with permissions to push and publish releases to the repo

name: Release

on:
workflow_dispatch:
inputs:
title:
description: 'Title to assign to the release'
required: true
type: string

tag:
description: 'Tag to assign to the release source code'
required: true
type: string

generate_release_notes:
description: 'Generate release notes?'
required: true
type: boolean

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

release:
name: Release
needs: ci
runs-on: ubuntu-20.04
steps:
- name: Fetch build artifacts
uses: actions/download-artifact@v2
with:
path: release-assets/

- name: Release
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v0.1.14
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ github.event.inputs.title }}
tag_name: ${{ github.event.inputs.tag }}
generate_release_notes: ${{ github.event.inputs.generate_release_notes }}
files: release-assets/Betaflight-Configurator-*/**
draft: true
prerelease: false
fail_on_unmatched_files: true
3 changes: 2 additions & 1 deletion .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: 'Close stale issues'

on:
workflow_dispatch:
schedule:
- cron: "30 4 * * *"

Expand All @@ -9,7 +10,7 @@ jobs:
name: 'Check and close stale issues'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
operations-per-run: 30
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

![Betaflight](http://static.rcgroups.net/forums/attachments/6/1/0/3/7/6/a9088900-228-bf_logo.jpg)

[![Latest version](https://img.shields.io/github/v/release/betaflight/betaflight-configurator)](https://github.com/betaflight/betaflight-configurator/releases) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/betaflight-configurator/localized.svg)](https://crowdin.com/project/betaflight-configurator) [![Build Status](https://travis-ci.com/betaflight/betaflight-configurator.svg?branch=master)](https://travis-ci.com/betaflight/betaflight-configurator) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=betaflight_betaflight-configurator&metric=alert_status)](https://sonarcloud.io/dashboard?id=betaflight_betaflight-configurator) [![Build Status](https://dev.azure.com/Betaflight/Betaflight%20Nightlies/_apis/build/status/betaflight.betaflight-configurator?branchName=master)](https://dev.azure.com/Betaflight/Betaflight%20Nightlies/_build/latest?definitionId=1&branchName=master) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Latest version](https://img.shields.io/github/v/release/betaflight/betaflight-configurator)](https://github.com/betaflight/betaflight-configurator/releases) [![Build](https://img.shields.io/github/workflow/status/betaflight/betaflight-configurator/Nightly)](https://github.com/betaflight/betaflight-configurator/actions/workflows/nightly.yml) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/betaflight-configurator/localized.svg)](https://crowdin.com/project/betaflight-configurator) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=betaflight_betaflight-configurator&metric=alert_status)](https://sonarcloud.io/dashboard?id=betaflight_betaflight-configurator) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)


Betaflight Configurator is a crossplatform configuration tool for the Betaflight flight control system.

Expand Down Expand Up @@ -62,7 +63,7 @@ If you experience graphics display problems or smudged/dithered fonts display is

### Unstable Testing Versions

Unstable testing versions of the lates builds of the configurator for most platforms can be downloaded from [here](https://github.com/betaflight/betaflight-configurator-nightlies/releases/).
Unstable testing versions of the latest builds of the configurator for most platforms can be downloaded from [here](https://github.com/betaflight/betaflight-configurator-nightlies/releases/).

**Be aware that these versions are intended for testing / feedback only, and may be buggy or broken, and can cause flight controller settings to be corrupted. Caution is advised when using these versions.**

Expand Down
Loading

0 comments on commit f353161

Please sign in to comment.