-
-
Notifications
You must be signed in to change notification settings - Fork 115
78 lines (65 loc) · 1.88 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build EmuFlight
on:
push:
tags:
- '*'
pull_request:
branches:
- '*'
jobs:
build:
strategy:
max-parallel: 1
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get build number
id: get_buildno
run: echo ::set-env name=BUILD_NUMBER::${{ github.run_number }}
- name: Get pull request number
id: get_pullno
run: echo ::set-env name=PULL_NUMBER::$(echo "$GITHUB_REF" | awk -F / '{print $3}')
if: startsWith(github.ref, 'refs/pull/')
- name: Get revision tag
id: get_revtag
run: echo "::set-output name=REVISION_TAG::${GITHUB_REF/refs\/tags\//}"
if: startsWith(github.ref, 'refs/tags/')
- 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
- name: Setup Python
uses: actions/setup-python@v1
- name: Setup Toolchain
uses: fiam/arm-none-eabi-gcc@v1
with:
release: '9-2019-q4' # The arm-none-eabi-gcc release to use.
- name: Get code version
id: get_version
run: echo "::set-output name=VERSION::$(make version)"
- name: Compile Code
run: |
make all
- name: Store Artifacts
uses: actions/upload-artifact@v2-preview
with:
name: EmuFlight-${{ steps.get_version.outputs.VERSION }}-${{ steps.get_buildno.outputs.BUILD_NUMBER }}
path: obj/*.hex
continue-on-error: true
- name: Release Binaries
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: EmuFlight-${{ steps.get_version.outputs.VERSION }}
prerelease: true
draft: true
files: obj/*.hex
env:
GITHUB_TOKEN: ${{ secrets.release_token }}