1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 21:05:30 +03:00

Add release action

This commit is contained in:
Miguel Angel Mulero Martinez 2022-02-17 11:17:00 +01:00
parent 51a6b60b0a
commit 149255bd9d
3 changed files with 74 additions and 15 deletions

View file

@ -2,12 +2,16 @@
#
# After building, artifacts are released to a seperate repository.
env:
debugBuild: true
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:
test:
@ -74,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: 90

View file

@ -1,15 +1,16 @@
# 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
@ -23,9 +24,11 @@ jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
with:
debug_build: true
release:
name: Release
name: Nightly release
needs: ci
runs-on: ubuntu-20.04
steps:
@ -38,7 +41,8 @@ jobs:
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_n
otes }}')"
- name: Get current date
id: date
@ -48,7 +52,7 @@ jobs:
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v0.1.14
with:
token: ${{ secrets.REPO_TOKEN }}
repository: ${{ env.repoNightly }}
repository: ${{ env.repo_nightly }}
tag_name: v${{ steps.date.outputs.today }}.${{ github.run_number }}
files: release-assets/Betaflight-Configurator-*/**
draft: false

51
.github/workflows/release.yml vendored Normal file
View file

@ -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