-
-
Notifications
You must be signed in to change notification settings - Fork 112
170 lines (148 loc) · 5.71 KB
/
push-master.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: HyperSerialPico CI Build
on: [push]
jobs:
###########################
#### HyperSerialPico ######
###########################
HyperSerialPico:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install GNU Arm Embedded Toolchain
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '12.2.Rel1'
- name: Build packages
shell: bash
run: |
mkdir build
cd build
cmake ..
cmake --build . --config Release
- uses: actions/upload-artifact@v3
name: Upload artifacts (commit)
if: (startsWith(github.event.ref, 'refs/tags') != true)
with:
path: |
firmware/*.uf2
- uses: actions/upload-artifact@v3
name: Upload artifacts (release)
if: startsWith(github.ref, 'refs/tags/')
with:
name: firmware-release
path: |
firmware/*.uf2
- name: Build packages for Adafruit Feather RP2040 Scorpio (release-only)
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
cd build
rm *.*
rm ../firmware/*
echo "Neopixel is using GPIO16(OUTPUT_DATA_PIN) on output 0." > ../firmware/Firmwares_for_Adafruit_Feather_RP2040_Scorpio.txt
echo "SPI is using spi0 interface pins: GPIO19(OUTPUT_SPI_DATA_PIN) and GPIO18(OUTPUT_SPI_CLOCK_PIN) on output 3 and 2 respectively." >> ../firmware/Firmwares_for_Adafruit_Feather_RP2040_Scorpio.txt
cmake -DOVERRIDE_BOOT_WORKAROUND=ON -DOVERRIDE_DATA_PIN=16 -DOVERRIDE_SPI_DATA_PIN=19 -DOVERRIDE_SPI_CLOCK_PIN=18 -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
zip -j ../firmware/Adafruit_Feather_RP2040_Scorpio.zip ../firmware/*
- uses: actions/upload-artifact@v3
name: Upload artifacts (release Adafruit_Feather)
if: startsWith(github.ref, 'refs/tags/')
with:
name: firmware-release
path: |
firmware/*.zip
- name: Build packages for Adafruit ItsyBitsy RP2040 (release-only)
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
cd build
rm *.*
rm ../firmware/*
echo "Neopixel is using GPIO14(OUTPUT_DATA_PIN) on output 5." > ../firmware/Firmwares_for_Adafruit_ItsyBitsy_2040.txt
cmake -DOVERRIDE_BOOT_WORKAROUND=ON -DOVERRIDE_DATA_PIN=14 -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
rm ../firmware/*_Spi.uf2
zip -j ../firmware/Adafruit_ItsyBitsy_2040.zip ../firmware/*
- uses: actions/upload-artifact@v3
name: Upload artifacts (release Adafruit_ItsyBitsy)
if: startsWith(github.ref, 'refs/tags/')
with:
name: firmware-release
path: |
firmware/*.zip
- name: Build packages for Pimoroni Plasma Stick 2040 W (release-only)
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
cd build
rm *.*
rm ../firmware/*
echo "Neopixel is using GPIO15(OUTPUT_DATA_PIN) on output PIXELS." > ../firmware/Firmwares_for_Pimoroni_Plasma_Stick_2040_W.txt
cmake -DOVERRIDE_DATA_PIN=15 -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
rm ../firmware/*_Spi.uf2
zip -j ../firmware/Pimoroni_Plasma_Stick_2040_W.zip ../firmware/*
- uses: actions/upload-artifact@v3
name: Upload artifacts (release Pimoroni_Plasma_Stick_W)
if: startsWith(github.ref, 'refs/tags/')
with:
name: firmware-release
path: |
firmware/*.zip
- name: Build packages for Pimoroni Plasma 2040 (release-only)
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
cd build
rm *.*
rm ../firmware/*
echo "Neopixel is using GPIO15(OUTPUT_DATA_PIN) on output DA." > ../firmware/Firmwares_for_Pimoroni_Plasma_2040.txt
echo "SPI is using spi1 interface pins: GPIO15(OUTPUT_SPI_DATA_PIN) and GPIO14(OUTPUT_SPI_CLOCK_PIN) on output DA and CL respectively." >> ../firmware/Firmwares_for_Pimoroni_Plasma_2040.txt
cmake -DOVERRIDE_DATA_PIN=15 -DOVERRIDE_SPI_INTERFACE=spi1 -DOVERRIDE_SPI_DATA_PIN=15 -DOVERRIDE_SPI_CLOCK_PIN=14 -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
zip -j ../firmware/Pimoroni_Plasma_2040.zip ../firmware/*
- uses: actions/upload-artifact@v3
name: Upload artifacts (release Pimoroni_Plasma)
if: startsWith(github.ref, 'refs/tags/')
with:
name: firmware-release
path: |
firmware/*.zip
################################
###### Publish Releases ########
################################
publish:
name: Publish Releases
if: startsWith(github.event.ref, 'refs/tags')
needs: [HyperSerialPico]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# generate environment variables
- name: Generate environment variables from version and tag
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "preRelease=false" >> $GITHUB_ENV
# If version contains alpha or beta, mark draft release as pre-release
- name: Mark release as pre-release
if: contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta')
run: echo "preRelease=true" >> $GITHUB_ENV
- uses: actions/download-artifact@v3
with:
name: firmware-release
# create draft release and upload artifacts
- name: Create draft release
uses: softprops/action-gh-release@v1
with:
name: HyperSerialPico ${{ env.VERSION }}
tag_name: ${{ env.TAG }}
files: |
*.uf2
*.zip
draft: true
prerelease: ${{ env.preRelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}