compose and use "dynamic" names for the assets to be released; sync "actions.yml" with "nightly.yaml"; formatting (#100)
This commit is contained in:
@@ -4,27 +4,14 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '2.4'
|
- '2.4'
|
||||||
|
- 'nightly_filenames'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- '2.4'
|
- '2.4'
|
||||||
|
|
||||||
jobs:
|
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:
|
test:
|
||||||
|
name: Run tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -52,9 +39,7 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
# fetch-depth: 0 # https://github.com/actions/checkout#Fetch-all-history-for-all-tags-and-branches
|
||||||
# - name: Fetch tags
|
|
||||||
# run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
||||||
|
|
||||||
- name: Test ${{ matrix.target }}
|
- name: Test ${{ matrix.target }}
|
||||||
env:
|
env:
|
||||||
@@ -71,12 +56,16 @@ jobs:
|
|||||||
./tools/build-gh.sh
|
./tools/build-gh.sh
|
||||||
|
|
||||||
- name: Compose release filename
|
- 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 }}
|
- name: Package firmware ${{ matrix.target }}
|
||||||
uses: 'actions/upload-artifact@v2'
|
uses: 'actions/upload-artifact@v2'
|
||||||
with:
|
with:
|
||||||
name: "$${ env.artifact_name }}"
|
name: "${{ env.artifact_name }}"
|
||||||
path: "${{ github.workspace }}/*.bin"
|
path: |
|
||||||
|
fw.json
|
||||||
|
LICENSE
|
||||||
|
*.bin
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|||||||
@@ -1,31 +1,20 @@
|
|||||||
---
|
---
|
||||||
name: Build and deploy nightly release
|
name: Build and deploy nightly release
|
||||||
on:
|
on:
|
||||||
# push:
|
push:
|
||||||
# branches: [ nightly_filenames ]
|
branches:
|
||||||
|
- 'nightly_filenames'
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 2 * * *' # run at 2 AM UTC
|
- cron: '0 2 * * *' # run at 2 AM UTC
|
||||||
|
|
||||||
jobs:
|
concurrency:
|
||||||
metadata:
|
group: 'nightly'
|
||||||
name: Store metadata
|
cancel-in-progress: true
|
||||||
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
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build firmware
|
name: Build firmware
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: metadata
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
target:
|
target:
|
||||||
@@ -62,7 +51,10 @@ jobs:
|
|||||||
uses: 'actions/upload-artifact@v2'
|
uses: 'actions/upload-artifact@v2'
|
||||||
with:
|
with:
|
||||||
name: edgetx-firmware-nightly
|
name: edgetx-firmware-nightly
|
||||||
path: "${{ github.workspace }}/*.bin"
|
path: |
|
||||||
|
fw.json
|
||||||
|
LICENSE
|
||||||
|
*.bin
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
@@ -78,16 +70,18 @@ jobs:
|
|||||||
path: edgetx-firmware-nightly
|
path: edgetx-firmware-nightly
|
||||||
|
|
||||||
- name: Compose release filename
|
- 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
|
- name: Zip release file
|
||||||
run: tar -cvzf ${{ env.release_filename }} ./edgetx-firmware-nightly
|
uses: montudor/action-zip@v1
|
||||||
|
with:
|
||||||
|
args: zip -qq -r ${{ env.release_filename }} ./edgetx-firmware-nightly
|
||||||
|
|
||||||
- name: Deploy release
|
- name: Deploy release
|
||||||
uses: "marvinpinto/action-automatic-releases@latest"
|
uses: marvinpinto/action-automatic-releases@latest
|
||||||
with:
|
with:
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
automatic_release_tag: "nightly"
|
automatic_release_tag: 'nightly'
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: |
|
files: |
|
||||||
${{ env.release_filename }}
|
*.zip
|
||||||
|
|||||||
Reference in New Issue
Block a user