mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 05:15:21 +03:00
Add release action
This commit is contained in:
parent
51a6b60b0a
commit
149255bd9d
3 changed files with 74 additions and 15 deletions
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
|
@ -2,12 +2,16 @@
|
||||||
#
|
#
|
||||||
# After building, artifacts are released to a seperate repository.
|
# After building, artifacts are released to a seperate repository.
|
||||||
|
|
||||||
env:
|
|
||||||
debugBuild: true
|
|
||||||
|
|
||||||
name: CI
|
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:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
@ -74,14 +78,14 @@ jobs:
|
||||||
- run: yarn install --immutable --immutable-cache --check-cache
|
- run: yarn install --immutable --immutable-cache --check-cache
|
||||||
|
|
||||||
- run: yarn gulp release ${{ matrix.releaseArgs }}
|
- run: yarn gulp release ${{ matrix.releaseArgs }}
|
||||||
if: ${{ !env.debugBuild }}
|
if: ${{ !inputs.debug_build && matrix.name != 'Android' }}
|
||||||
|
|
||||||
- run: yarn gulp debug-release ${{ matrix.releaseArgs }}
|
- run: yarn gulp debug-release ${{ matrix.releaseArgs }}
|
||||||
if: ${{ env.debugBuild }}
|
if: ${{ inputs.debug_build || matrix.name == 'Android' }}
|
||||||
|
|
||||||
- name: Publish build artifacts
|
- name: Publish build artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Betaflight-Configurator${{ env.debugBuild == 'true' && '-Debug' || '' }}-${{ matrix.name }}
|
name: Betaflight-Configurator${{ inputs.debug_build == 'true' && '-Debug' || '' }}-${{ matrix.name }}
|
||||||
path: release/
|
path: release/
|
||||||
retention-days: 90
|
retention-days: 90
|
||||||
|
|
20
.github/workflows/nightly.yml
vendored
20
.github/workflows/nightly.yml
vendored
|
@ -1,15 +1,16 @@
|
||||||
# You'll need to setup the follwing environment variables:
|
# You'll need to setup the follwing environment variables:
|
||||||
# env.repoNightly - The repository to release nightly builds to e.g. betaflight-configurator-nightly
|
# env.repo_nightly - 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.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
|
# secrets.REPO_TOKEN - A GitHub token with permissions to push and publish releases to the nightly repo
|
||||||
|
|
||||||
env:
|
env:
|
||||||
repoNightly: betaflight/betaflight-configurator-nightlies
|
repo_nightly: betaflight/betaflight-configurator-nightlies
|
||||||
debugReleaseNotes: >
|
debug_release_notes: >
|
||||||
This is an automated development build.
|
This is an automated development build.
|
||||||
It may be unstable and result in corrupted configurations or data loss.
|
It may be unstable and result in corrupted configurations or data loss.
|
||||||
**Use only for testing.**
|
**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
|
name: Nightly
|
||||||
|
|
||||||
|
@ -23,9 +24,11 @@ jobs:
|
||||||
ci:
|
ci:
|
||||||
name: CI
|
name: CI
|
||||||
uses: ./.github/workflows/ci.yml
|
uses: ./.github/workflows/ci.yml
|
||||||
|
with:
|
||||||
|
debug_build: true
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Nightly release
|
||||||
needs: ci
|
needs: ci
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
|
@ -38,7 +41,8 @@ jobs:
|
||||||
id: notes
|
id: notes
|
||||||
run: |
|
run: |
|
||||||
set -- release-assets/Betaflight-Configurator-Debug-*
|
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
|
- name: Get current date
|
||||||
id: date
|
id: date
|
||||||
|
@ -48,7 +52,7 @@ jobs:
|
||||||
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v0.1.14
|
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v0.1.14
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.REPO_TOKEN }}
|
token: ${{ secrets.REPO_TOKEN }}
|
||||||
repository: ${{ env.repoNightly }}
|
repository: ${{ env.repo_nightly }}
|
||||||
tag_name: v${{ steps.date.outputs.today }}.${{ github.run_number }}
|
tag_name: v${{ steps.date.outputs.today }}.${{ github.run_number }}
|
||||||
files: release-assets/Betaflight-Configurator-*/**
|
files: release-assets/Betaflight-Configurator-*/**
|
||||||
draft: false
|
draft: false
|
||||||
|
|
51
.github/workflows/release.yml
vendored
Normal file
51
.github/workflows/release.yml
vendored
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue