Skip to content

bump version 0.3.5 (#544) #2908

bump version 0.3.5 (#544)

bump version 0.3.5 (#544) #2908

Workflow file for this run

on:
push:
tags:
- '*'
branches:
- '*'
pull_request:
branches:
- '*'
# repository_dispatch is a newer github-actions feature that will allow building from triggers other than code merge/PR
repository_dispatch:
types: [build]
name: Build EmuFlight
jobs:
build:
timeout-minutes: 75
strategy:
max-parallel: 4
matrix:
targets: [targets-group-1, targets-group-2, targets-group-3, targets-group-rest]
runs-on: ubuntu-latest
steps:
# curl, by default, may timeout easily
- name: curl fix
run: function curl () { command curl --connect-timeout 30 --retry 10 "$@" ; }
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Take the trash out
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
docker rmi -f $(docker image ls -aq)
sync
df -h
continue-on-error: true
- name: Setup Python
uses: actions/setup-python@v1
- name: Setup Toolchain
uses: fiam/arm-none-eabi-gcc@master
with:
release: '9-2020-q2' # The arm-none-eabi-gcc release to use.
- name: Get code version
id: get_version
run: echo "VERSION=$(make version)" >> $GITHUB_ENV
# for Makefile interaction
- name: Get GitHub Build Number (ENV)
id: get_buildno
run: echo "GITHUBBUILDNUMBER=${{ github.run_number }}" >> $GITHUB_ENV
continue-on-error: true
- name: Get pull request number
id: get_pullno
run: echo "PULL_NUMBER=$(echo "$GITHUB_REF" | awk -F / '{print $3}')" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/pull/')
- name: Get revision tag
id: get_revtag
run: echo "REVISION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/')
- name: Make artifact name
id: make_artifactname
run: |
if [[ "${{ github.REPOSITORY }}" == "emuflight/EmuFlight" ]] ; then
ARTIFACT_NAME="EmuFlight-${{ env.VERSION }}-${{ github.run_number }}"
else
ARTIFACT_NAME="EmuFlight-${{ env.VERSION }}-${{ github.ACTOR }}-${{ github.run_number }}"
fi
echo "${ARTIFACT_NAME}"
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
# for debugging
- name: Show Variables
id: show_vars
run: |
echo "Actor: ${{ github.ACTOR }}"
echo "Repo: ${{ github.REPOSITORY }}"
echo "Build: ${{ github.run_number }}"
echo "Firmware: ${{ env.VERSION }}"
echo "Commit: ${{ github.sha }}"
echo "Tag: ${{ env.REVISION_TAG}}"
echo "Artifact name: ${{ env.ARTIFACT_NAME }}"
continue-on-error: true
- name: Compile Code
run: |
make ${{ matrix.targets }}
# Upload the Builds to ZIP file with existing SHA in .hex names
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME }}
path: obj/*.hex
# Upload to Bintray before .hex renames / only for tag
- name: Upload to Bintray
if: startsWith(github.ref, 'refs/tags/')
run: |
curl -fL https://getcli.jfrog.io | sh
export JFROG_CLI_OFFER_CONFIG=false
export CI=true
export JFROG_CLI_LOG_LEVEL=DEBUG
./jfrog bt config --user=${{secrets.BINTRAYUSERNAME}} --key=${{secrets.BINTRAYAPIKEY}} --licenses=GPL-3.0
export repo="emuflight-dev/dev_hex"
export package="${{env.REVISION_TAG}}"
export version="${{github.run_number}}-${{env.VERSION}}-${{env.REVISION_TAG}}"
./jfrog bt package-create --pub-dn=true --vcs-url="https://github.com/emuflight" "${repo}/${package}" || true
./jfrog bt version-create "${repo}/${package}/${version}" || true
./jfrog bt upload --publish=true "obj/*.hex" "${repo}/${package}/${version}" "GitHub_Build_${version}/" || true
continue-on-error: true
# Rename .hex for Releases
- name: Rename Artifacts
if: startsWith(github.ref, 'refs/tags/')
run: |
sudo apt -y install rename
cd obj
rename 's/_Build_.*/.hex/' *.hex
- name: Draft Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: obj/*.hex
draft: true
prerelease: true
tag_name: ${{ github.run_number }} # use the build Number, but we manually change to version so that it creates a version-tag on release
name: DRAFT / EmuFlight ${{ env.VERSION }} / GitHub Build ${{ github.run_number }}
body: |
# EmuFlight ${{ env.VERSION }}
## BuildTag: ${{ env.REVISION_TAG}}
## Commit: ${{ github.sha }}
## Changes in this Release:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}