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

This commit is contained in:
Tom Hensel
2021-05-28 10:26:38 +02:00
committed by GitHub
parent 67760354b8
commit 8d86907120
2 changed files with 29 additions and 46 deletions
+10 -21
View File
@@ -4,27 +4,14 @@ on:
push:
branches:
- '2.4'
- 'nightly_filenames'
pull_request:
branches:
- '2.4'
jobs:
metadata:
name: Store metadata
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Package common files
uses: 'actions/upload-artifact@v2'
with:
name: edgetx-firmware-nightly
path: |
fw.json
LICENSE
README.md
test:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
@@ -52,9 +39,7 @@ jobs:
uses: actions/checkout@v2
with:
submodules: recursive
# - name: Fetch tags
# run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
# fetch-depth: 0 # https://github.com/actions/checkout#Fetch-all-history-for-all-tags-and-branches
- name: Test ${{ matrix.target }}
env:
@@ -71,12 +56,16 @@ jobs:
./tools/build-gh.sh
- name: Compose release filename
run: echo "artifact_name=edgetx-firmware-${GITHUB_REF}" >> $GITHUB_ENV
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
run: echo "artifact_name=edgetx-firmware-${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Package firmware ${{ matrix.target }}
uses: 'actions/upload-artifact@v2'
with:
name: "$${ env.artifact_name }}"
path: "${{ github.workspace }}/*.bin"
name: "${{ env.artifact_name }}"
path: |
fw.json
LICENSE
*.bin
retention-days: 15
if-no-files-found: error
+19 -25
View File
@@ -1,31 +1,20 @@
---
name: Build and deploy nightly release
on:
# push:
# branches: [ nightly_filenames ]
push:
branches:
- 'nightly_filenames'
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
jobs:
metadata:
name: Store metadata
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Package common files
uses: 'actions/upload-artifact@v2'
with:
name: edgetx-firmware-nightly
path: |
fw.json
LICENSE
README.md
concurrency:
group: 'nightly'
cancel-in-progress: true
jobs:
build:
name: Build firmware
runs-on: ubuntu-latest
needs: metadata
strategy:
matrix:
target:
@@ -62,7 +51,10 @@ jobs:
uses: 'actions/upload-artifact@v2'
with:
name: edgetx-firmware-nightly
path: "${{ github.workspace }}/*.bin"
path: |
fw.json
LICENSE
*.bin
retention-days: 15
if-no-files-found: error
@@ -78,16 +70,18 @@ jobs:
path: edgetx-firmware-nightly
- name: Compose release filename
run: echo "release_filename=edgetx-firmware-nightly-${GITHUB_SHA::8}.tgz" >> $GITHUB_ENV
run: echo "release_filename=edgetx-firmware-nightly-${GITHUB_SHA::8}.zip" >> $GITHUB_ENV
- name: Package files
run: tar -cvzf ${{ env.release_filename }} ./edgetx-firmware-nightly
- name: Zip release file
uses: montudor/action-zip@v1
with:
args: zip -qq -r ${{ env.release_filename }} ./edgetx-firmware-nightly
- name: Deploy release
uses: "marvinpinto/action-automatic-releases@latest"
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "nightly"
automatic_release_tag: 'nightly'
prerelease: true
files: |
${{ env.release_filename }}
*.zip