From f58317f74ed3483e0a1d0384801bcc6c3b62933f Mon Sep 17 00:00:00 2001 From: gretel Date: Wed, 26 May 2021 23:33:32 +0200 Subject: [PATCH] compose and use "dynamic" names for the assets to be released; sync "actions.yml" with "nightly.yaml"; formatting --- .github/workflows/actions.yml | 66 +++++++++++-------- .../workflows/{nightly.yaml => nightly.yml} | 12 ++-- 2 files changed, 46 insertions(+), 32 deletions(-) rename .github/workflows/{nightly.yaml => nightly.yml} (87%) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index b2d23ad55..b18cbfb9b 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -1,71 +1,81 @@ -name: Commit Tests +--- +name: Run tests and package firmware on: push: - branches: [ 2.4 ] + branches: + - '2.4' pull_request: - branches: [ 2.4 ] + branches: + - '2.4' jobs: metadata: + name: Store metadata runs-on: ubuntu-latest steps: - name: Check out the repo uses: actions/checkout@v2 - with: - submodules: recursive - - name: Package metadata ${{ matrix.target }} + - name: Package common files uses: 'actions/upload-artifact@v2' with: - name: edgetx-firmware - path: fw.json + name: edgetx-firmware-nightly + path: | + fw.json + LICENSE + README.md + test: runs-on: ubuntu-latest strategy: matrix: target: - - X9LITE - - X7 - T12 - - TX12 + - T16 - T8 - TLITE - - XLITE + - TX12 + - TX16S + - X10 + - X12S + - X7 - X9DP - X9DP2019 - - X10 - - T16 - - TX16S - - X12S + - X9LITE + - XLITE container: image: ghcr.io/edgetx/edgetx-commit-tests volumes: - ${{ github.workspace }}:/src steps: - - - name: Check out the repo + - name: Check out the repo uses: actions/checkout@v2 with: submodules: recursive - # - - # name: Fetch tags + + # - name: Fetch tags # run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - - name: Test ${{ matrix.target }} + + - name: Test ${{ matrix.target }} env: FLAVOR: ${{ matrix.target }} run: | echo "Running commit tests" ./tools/commit-tests.sh - - - name: Build ${{ matrix.target }} + + - name: Build ${{ matrix.target }} env: FLAVOR: ${{ matrix.target }} run: | echo "Running firmware build" ./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' with: - name: edgetx-firmware - path: ${{ github.workspace }}/*.bin \ No newline at end of file + name: "$${ env.artifact_name }}" + path: "${{ github.workspace }}/*.bin" + retention-days: 15 + if-no-files-found: error diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yml similarity index 87% rename from .github/workflows/nightly.yaml rename to .github/workflows/nightly.yml index 0ff31691d..a7b5e4a65 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yml @@ -1,8 +1,8 @@ --- name: Build and deploy nightly release on: -# push: -# branches: [ 2.4 ] + # push: + # branches: [ nightly_filenames ] schedule: - cron: '0 2 * * *' # run at 2 AM UTC @@ -51,6 +51,7 @@ jobs: uses: actions/checkout@v2 with: submodules: recursive + - name: Build firmware ${{ matrix.target }} env: FLAVOR: ${{ matrix.target }} @@ -75,8 +76,11 @@ jobs: name: 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 - run: tar -cvzf edgetx-firmware-nightly.tgz ./edgetx-firmware-nightly + run: tar -cvzf ${{ env.release_filename }} ./edgetx-firmware-nightly - name: Deploy release uses: "marvinpinto/action-automatic-releases@latest" @@ -85,4 +89,4 @@ jobs: automatic_release_tag: "nightly" prerelease: true files: | - edgetx-firmware-nightly.tgz + ${{ env.release_filename }}