6
6
push :
7
7
branches : ["main"]
8
8
paths-ignore :
9
- - ' **.md'
9
+ - " **.md"
10
10
11
11
# Allows you to run this workflow manually from the Actions tab
12
12
workflow_dispatch :
@@ -28,113 +28,70 @@ jobs:
28
28
build :
29
29
runs-on : ubuntu-latest
30
30
steps :
31
- - name : Checkout
32
- uses : actions/checkout@v3
33
-
34
- # Install the Arduino CLI
35
- - name : Install Arduino CLI
36
- uses : arduino/setup-arduino-cli@v1
37
-
38
- # Install TFT_eSPI
39
- - name : Install TFT_eSPI library to prepare for modifications
40
- run : |
41
- arduino-cli lib install TFT_eSPI
42
-
43
- # Copy binaries to GitHubPages folder for publishing
44
- - name : Copy User_Setup.h for TFT_eSPI
31
+ - uses : actions/checkout@v4
32
+ - uses : actions/cache@v3
33
+ - name : Cache pip
34
+ uses : actions/cache@v3
35
+ with :
36
+ path : ~/.cache/pip
37
+ key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
38
+ restore-keys : |
39
+ ${{ runner.os }}-pip-
40
+ - name : Cache PlatformIO
41
+ uses : actions/cache@v3
42
+ with :
43
+ path : ~/.platformio
44
+ key : ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
45
+ - name : Set up Python
46
+ uses : actions/setup-python@v4
47
+ with :
48
+ python-version : " 3.10"
49
+ - name : Install PlatformIO
45
50
run : |
46
- \cp -fR DisplayConfig/User_Setup.h ~/Arduino/libraries/TFT_eSPI/
47
-
48
- # Build CYD Arduino Code
49
- - uses : arduino/compile-sketches@v1
50
- name : Compile CYD code
51
- with :
52
- fqbn : " esp32:esp32:esp32"
53
- platforms : |
54
- - name: esp32:esp32
55
- source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
56
- # No need to specify ESP-libraries as these are installed with the platform (on the line above).
57
- # Downloading SpeedyStepper from source to get correct casing on import of Arduino.h (spelled arduino.h in the version from Arduino Library Manager)
58
- libraries : |
59
- - name: SpotifyArduino
60
- source-url: https://github.com/witnessmenow/spotify-api-arduino.git
61
- - name: WiFiManager
62
- - name: ESP_DoubleResetDetector
63
- - name: ArduinoJson
64
- - name: JPEGDEC
65
- - name: Seeed_Arduino_NFC
66
- source-url: https://github.com/witnessmenow/Seeed_Arduino_NFC.git
67
- sketch-paths : |
68
- - SpotifyDiyThing
69
- enable-warnings-report : true
70
- verbose : false
71
- cli-compile-flags : |
72
- - --export-binaries
73
- - --build-property
74
- - compiler.warning_flags=-Wno-error
75
-
76
- # Copy binaries to GitHubPages folder for publishing
77
- - name : Copy compiled binaries to CYD
51
+ python -m pip install --upgrade pip
52
+ pip install --upgrade platformio
53
+
54
+ # Build CYD
55
+ - name : Build CYD
56
+ run : platformio run -e cyd
57
+ - name : Upload artifact
58
+ uses : actions/upload-artifact@v3
59
+ with :
60
+ name : CYD Firmware
61
+ path : .pio/build/cyd/firmware.bin
62
+ if-no-files-found : error
63
+ - name : Copy compiled binaries for webflash
78
64
run : |
79
- # mkdir GitHubPages/ESPWebTools/esp32Firmware
80
65
mkdir GitHubPages/ESPWebTools/cyd
81
66
82
67
# Copy the manifest file for the CYD
83
68
cp GitHubPages/ESPWebTools/manifest.json GitHubPages/ESPWebTools/cyd
84
-
85
- # Copy compiled binaries that were exported by the `-e` flag in the arduino/compile-sketches task
86
- # Maintain folder structure, for cases where we are compiling for multiple board versions
87
- # If we were sure that we would never need to compile for anything other then esp32:esp32:esp32, we could have used this command instead: cp -r OpenMacroRail_Arduino/build/esp32.esp32.esp32/*.bin GitHubPages/ESPWebTools/esp32Firmware
88
- cd SpotifyDiyThing/build
89
- find . -print | grep -i .bin$ | xargs -i cp --parent {} ../../GitHubPages/ESPWebTools/cyd
90
- cd ../..
91
-
92
- # Copy boot_app0.bin to the esp32Firmware folder. This file will be common for all esp32 boards (i think)
93
- # Using a version agnostic search to find the file. grep -m 1 makes sure only one file is copied in case multiple versions are installed.
94
- find /home/runner/.arduino15/packages/esp32/hardware/esp32/ -type f | grep -i -m 1 boot_app0.bin$ | xargs -i cp {} GitHubPages/ESPWebTools/cyd
95
69
96
- # Build Matrix Arduino Code
97
- - uses : arduino/compile-sketches@v1
98
- name : Compile Matrix code
99
- with :
100
- fqbn : " esp32:esp32:esp32"
101
- platforms : |
102
- - name: esp32:esp32
103
- source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
104
- # No need to specify ESP-libraries as these are installed with the platform (on the line above).
105
- # Just need to specify the matrix specific libraries, the others are already installed.
106
- libraries : |
107
- - name: ESP32 HUB75 LED MATRIX PANEL DMA Display
108
- source-url: https://github.com/witnessmenow/ESP32-HUB75-MatrixPanel-I2S-DMA.git
109
- - name: Adafruit GFX Library
110
- sketch-paths : |
111
- - SpotifyDiyThing
112
- enable-warnings-report : true
113
- verbose : false
114
- cli-compile-flags : |
115
- - --build-property
116
- - compiler.cpp.extra_flags=-DMATRIX_DISPLAY
117
- - --build-property
118
- - compiler.warning_flags=-Wno-error
119
- - --export-binaries
120
-
121
- # Copy binaries to GitHubPages folder for publishing
122
- - name : Copy compiled binaries to Matrix
70
+ cp .pio/build/cyd/bootloader.bin GitHubPages/ESPWebTools/cyd
71
+ cp .pio/build/cyd/partitions.bin GitHubPages/ESPWebTools/cyd
72
+ cp /home/runner/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin GitHubPages/ESPWebTools/cyd
73
+ cp .pio/build/cyd/firmware.bin GitHubPages/ESPWebTools/cyd
74
+
75
+ # Build Matrix
76
+ - name : Build Matrix
77
+ run : platformio run -e trinity
78
+ - name : Upload artifact
79
+ uses : actions/upload-artifact@v3
80
+ with :
81
+ name : CYD Firmware
82
+ path : .pio/build/trinity/firmware.bin
83
+ if-no-files-found : error
84
+ - name : Copy compiled binaries for webflash
123
85
run : |
124
- # Make matrix directory
125
86
mkdir GitHubPages/ESPWebTools/matrix
126
87
127
- # Copy the manifest file for the matrix
88
+ # Copy the manifest file for the CYD
128
89
cp GitHubPages/ESPWebTools/manifest.json GitHubPages/ESPWebTools/matrix
129
-
130
- cd SpotifyDiyThing/build
131
- find . -print | grep -i .bin$ | xargs -i cp --parent {} ../../GitHubPages/ESPWebTools/matrix
132
- cd ../..
133
-
134
- # Copy boot_app0.bin to the esp32Firmware folder. This file will be common for all esp32 boards (i think)
135
- # Using a version agnostic search to find the file. grep -m 1 makes sure only one file is copied in case multiple versions are installed.
136
- find /home/runner/.arduino15/packages/esp32/hardware/esp32/ -type f | grep -i -m 1 boot_app0.bin$ | xargs -i cp {} GitHubPages/ESPWebTools/matrix
137
90
91
+ cp .pio/build/trinity/bootloader.bin GitHubPages/ESPWebTools/matrix
92
+ cp .pio/build/trinity/partitions.bin GitHubPages/ESPWebTools/matrix
93
+ cp /home/runner/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin GitHubPages/ESPWebTools/matrix
94
+ cp .pio/build/trinity/firmware.bin GitHubPages/ESPWebTools/matrix
138
95
139
96
# Build GitHub Page
140
97
- name : Setup Github Page
0 commit comments