-
Notifications
You must be signed in to change notification settings - Fork 3
93 lines (79 loc) · 2.5 KB
/
generate-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
name: Raspberry Pi Pico CoreMark Build
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: '3.x'
- name: Install RP2040 SDK
run: |
git clone https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git submodule update --init
echo "PICO_SDK_PATH=$(pwd)" >> $GITHUB_ENV
- name: Configure CMake
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DPICO_PLATFORM=rp2040 -DPICO_SDK_PATH=$PICO_SDK_PATH
- name: Build firmware
run: |
cd build
echo "Build machine has $(nproc) cores."
make -j$(nproc)
- name: Check if release files exists
run: |
cd build
FILE=Coremark-RP2040.uf2
if [ -f "$FILE" ]; then
echo "$FILE exists."
fi
- name: Create release
id: create_release
uses: actions/create-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload release assets
uses: actions/upload-release-asset@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/Coremark-RP2040.elf
asset_name: Coremark-RP2040.elf
asset_content_type: application/octet-stream
- name: Upload release assets
uses: actions/upload-release-asset@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/Coremark-RP2040.hex
asset_name: Coremark-RP2040.hex
asset_content_type: application/octet-stream
- name: Upload release assets
uses: actions/upload-release-asset@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/Coremark-RP2040.uf2
asset_name: Coremark-RP2040.uf2
asset_content_type: application/octet-stream