Skip to content

Commit

Permalink
github action workflow update/fixes (#407)
Browse files Browse the repository at this point in the history
* github action workflow update/fixes
* required due to GitHub deprecations
  • Loading branch information
nerdCopter authored Nov 17, 2020
1 parent 0ac4c3a commit 44e23cd
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,38 +43,38 @@ jobs:
uses: actions/setup-python@v1

- name: Setup Toolchain
uses: fiam/arm-none-eabi-gcc@v1.0.2
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 "::set-output name=VERSION::$(make version)"
run: echo "VERSION=$(make version)" >> $GITHUB_ENV

# for Makefile interaction
- name: Get GitHub Build Number (ENV)
id: get_buildno
run: echo ::set-env name=GITHUBBUILDNUMBER::${{ github.run_number }}
run: echo "GITHUBBUILDNUMBER=${{ github.run_number }}" >> $GITHUB_ENV
continue-on-error: true

- name: Get pull request number
id: get_pullno
run: echo ::set-env name=PULL_NUMBER::$(echo "$GITHUB_REF" | awk -F / '{print $3}')
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 "::set-output name=REVISION_TAG::${GITHUB_REF/refs\/tags\//}"
run: echo "REVISION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/')

# for debugging
- name: Show Variables
id: show_vars
run: |
echo "Build: ${{ github.run_number }}"
echo "Firmware ${{ steps.get_version.outputs.VERSION }}"
echo "Firmware: ${{ env.VERSION }}"
echo "Commit: ${{ github.sha }}"
echo "tag: ${{ steps.get_revtag.outputs.REVISION_TAG}}"
echo "tag: ${{ env.REVISION_TAG}}"
continue-on-error: true

- name: Compile Code
Expand All @@ -85,7 +85,7 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: EmuFlight-${{ steps.get_version.outputs.VERSION }}-${{ github.run_number }}
name: EmuFlight-${{ env.VERSION }}-${{ github.run_number }}
path: obj/*.hex

# Upload to Bintray before .hex renames / only for tag
Expand All @@ -98,8 +98,8 @@ jobs:
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="${{steps.get_revtag.outputs.REVISION_TAG}}"
export version="${{github.run_number}}-${{steps.get_version.outputs.VERSION}}-${{steps.get_revtag.outputs.REVISION_TAG}}"
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
Expand All @@ -121,10 +121,10 @@ jobs:
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 ${{ steps.get_version.outputs.VERSION }} / GitHub Build ${{ github.run_number }}
name: DRAFT / EmuFlight ${{ env.VERSION }} / GitHub Build ${{ github.run_number }}
body: |
# EmuFlight ${{ steps.get_version.outputs.VERSION }}
## BuildTag: ${{ steps.get_revtag.outputs.REVISION_TAG}}
# EmuFlight ${{ env.VERSION }}
## BuildTag: ${{ env.REVISION_TAG}}
## Commit: ${{ github.sha }}
## Changes in this Release:
env:
Expand Down

0 comments on commit 44e23cd

Please sign in to comment.