compose and use "dynamic" names for the assets to be released; sync "actions.yml" with "nightly.yaml"; formatting

This commit is contained in:
gretel
2021-05-27 00:32:13 +02:00
committed by Raphael Coeffic
parent 447d7bde22
commit f58317f74e
2 changed files with 46 additions and 32 deletions
+38 -28
View File
@@ -1,71 +1,81 @@
name: Commit Tests ---
name: Run tests and package firmware
on: on:
push: push:
branches: [ 2.4 ] branches:
- '2.4'
pull_request: pull_request:
branches: [ 2.4 ] branches:
- '2.4'
jobs: jobs:
metadata: metadata:
name: Store metadata
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out the repo - name: Check out the repo
uses: actions/checkout@v2 uses: actions/checkout@v2
with: - name: Package common files
submodules: recursive
- name: Package metadata ${{ matrix.target }}
uses: 'actions/upload-artifact@v2' uses: 'actions/upload-artifact@v2'
with: with:
name: edgetx-firmware name: edgetx-firmware-nightly
path: fw.json path: |
fw.json
LICENSE
README.md
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
target: target:
- X9LITE
- X7
- T12 - T12
- TX12 - T16
- T8 - T8
- TLITE - TLITE
- XLITE - TX12
- TX16S
- X10
- X12S
- X7
- X9DP - X9DP
- X9DP2019 - X9DP2019
- X10 - X9LITE
- T16 - XLITE
- TX16S
- X12S
container: container:
image: ghcr.io/edgetx/edgetx-commit-tests image: ghcr.io/edgetx/edgetx-commit-tests
volumes: volumes:
- ${{ github.workspace }}:/src - ${{ github.workspace }}:/src
steps: steps:
- - name: Check out the repo
name: Check out the repo
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
submodules: recursive submodules: recursive
# -
# name: Fetch tags # - name: Fetch tags
# run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* # run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
-
name: Test ${{ matrix.target }} - name: Test ${{ matrix.target }}
env: env:
FLAVOR: ${{ matrix.target }} FLAVOR: ${{ matrix.target }}
run: | run: |
echo "Running commit tests" echo "Running commit tests"
./tools/commit-tests.sh ./tools/commit-tests.sh
-
name: Build ${{ matrix.target }} - name: Build ${{ matrix.target }}
env: env:
FLAVOR: ${{ matrix.target }} FLAVOR: ${{ matrix.target }}
run: | run: |
echo "Running firmware build" echo "Running firmware build"
./tools/build-gh.sh ./tools/build-gh.sh
-
name: Package firmware ${{ matrix.target }} - name: Compose release filename
run: echo "artifact_name=edgetx-firmware-${GITHUB_REF}" >> $GITHUB_ENV
- name: Package firmware ${{ matrix.target }}
uses: 'actions/upload-artifact@v2' uses: 'actions/upload-artifact@v2'
with: with:
name: edgetx-firmware name: "$${ env.artifact_name }}"
path: ${{ github.workspace }}/*.bin path: "${{ github.workspace }}/*.bin"
retention-days: 15
if-no-files-found: error
@@ -1,8 +1,8 @@
--- ---
name: Build and deploy nightly release name: Build and deploy nightly release
on: on:
# push: # push:
# branches: [ 2.4 ] # branches: [ nightly_filenames ]
schedule: schedule:
- cron: '0 2 * * *' # run at 2 AM UTC - cron: '0 2 * * *' # run at 2 AM UTC
@@ -51,6 +51,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
submodules: recursive submodules: recursive
- name: Build firmware ${{ matrix.target }} - name: Build firmware ${{ matrix.target }}
env: env:
FLAVOR: ${{ matrix.target }} FLAVOR: ${{ matrix.target }}
@@ -75,8 +76,11 @@ jobs:
name: edgetx-firmware-nightly name: edgetx-firmware-nightly
path: edgetx-firmware-nightly path: edgetx-firmware-nightly
- name: Compose release filename
run: echo "release_filename=edgetx-firmware-nightly-${GITHUB_SHA::8}.tgz" >> $GITHUB_ENV
- name: Package files - name: Package files
run: tar -cvzf edgetx-firmware-nightly.tgz ./edgetx-firmware-nightly run: tar -cvzf ${{ env.release_filename }} ./edgetx-firmware-nightly
- name: Deploy release - name: Deploy release
uses: "marvinpinto/action-automatic-releases@latest" uses: "marvinpinto/action-automatic-releases@latest"
@@ -85,4 +89,4 @@ jobs:
automatic_release_tag: "nightly" automatic_release_tag: "nightly"
prerelease: true prerelease: true
files: | files: |
edgetx-firmware-nightly.tgz ${{ env.release_filename }}