-
-
Notifications
You must be signed in to change notification settings - Fork 60
103 lines (100 loc) · 3.74 KB
/
release.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
on:
push:
tags:
- 'v3.*'
name: Upload Release Assets
env:
MAKEOPTS: -j2
jobs:
upload_release:
name: Upload Release Assets
runs-on: ubuntu-20.04
steps:
- name: Check cache
id: check-cache
uses: actions/cache@v2
with:
path: ${{ runner.tool_cache }}/gcc-arm-10-2020-q4
key: gcc-arm-10-2020-q4
- name: Download
if: steps.check-cache.outputs.cache-hit != 'true'
uses: dlech/arm-none-eabi-gcc@master
with:
release: '10-2020-q4'
directory: ${{ runner.tool_cache }}/gcc-arm-10-2020-q4
- name: Add cross-compiler to path
run: echo ${{ runner.tool_cache }}/gcc-arm-10-2020-q4/bin >> $GITHUB_PATH
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- name: Build firmware
run: |
make $MAKEOPTS -C micropython/mpy-cross
make $MAKEOPTS -C bricks/movehub
make $MAKEOPTS -C bricks/cityhub
make $MAKEOPTS -C bricks/technichub
make $MAKEOPTS -C bricks/primehub
make $MAKEOPTS -C bricks/essentialhub
- name: Get tag
run: echo "GITHUB_TAG=${GITHUB_REF#*refs/tags/}" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: ${{ contains(env.GITHUB_TAG, 'a') || contains(env.GITHUB_TAG, 'b') || contains(env.GITHUB_TAG, 'c') }}
- name: Upload movehub firmware
id: upload-movehub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bricks/movehub/build/firmware.zip
asset_name: pybricks-movehub-${{ env.GITHUB_TAG }}.zip
asset_content_type: application/zip
- name: Upload cityhub firmware
id: upload-cityhub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bricks/cityhub/build/firmware.zip
asset_name: pybricks-cityhub-${{ env.GITHUB_TAG }}.zip
asset_content_type: application/zip
- name: Upload technichub firmware
id: upload-technichub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bricks/technichub/build/firmware.zip
asset_name: pybricks-technichub-${{ env.GITHUB_TAG }}.zip
asset_content_type: application/zip
- name: Upload primehub firmware
id: upload-primehub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bricks/primehub/build/firmware.zip
asset_name: pybricks-primehub-${{ env.GITHUB_TAG }}.zip
asset_content_type: application/zip
- name: Upload essentialhub firmware
id: upload-essentialhub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bricks/essentialhub/build/firmware.zip
asset_name: pybricks-essentialhub-${{ env.GITHUB_TAG }}.zip
asset_content_type: application/zip