Update development time (#55) #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: HyperSPI Pico CI Build | |
on: [push] | |
jobs: | |
############################# | |
#### HyperSPI for Pico ###### | |
############################# | |
HyperSpiPico: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./rp2040 | |
steps: | |
- uses: actions/checkout@v4 | |
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 | |
zip -j ../HyperSerialPico/firmware/hyperspi_pico_rp2040.zip ../HyperSerialPico/firmware/*.uf2 | |
- uses: actions/upload-artifact@v4 | |
name: Upload artifacts (commit) | |
if: (startsWith(github.event.ref, 'refs/tags') != true) | |
with: | |
name: commit-artifact-pico | |
path: | | |
rp2040/HyperSerialPico/firmware/*.zip | |
- uses: actions/upload-artifact@v4 | |
name: Upload artifacts (release) | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: release-artifact-pico | |
path: | | |
rp2040/HyperSerialPico/firmware/*.zip | |
- name: Build packages for Adafruit Feather RP2040 Scorpio | |
shell: bash | |
run: | | |
cd build | |
rm *.* | |
rm ../HyperSerialPico/firmware/* | |
echo "Neopixel is using GPIO16(OUTPUT_DATA_PIN) on output 0." > ../HyperSerialPico/firmware/Firmware_for_Adafruit_Feather_RP2040_Scorpio.txt | |
echo "SPI MOSI->MISO is GPIO28 (A2)" >> ../HyperSerialPico/firmware/Firmware_for_Adafruit_Feather_RP2040_Scorpio.txt | |
echo "SPI SCK is GPIO26 (A0)" >> ../HyperSerialPico/firmware/Firmware_for_Adafruit_Feather_RP2040_Scorpio.txt | |
echo "SPI CHIP_SELECT is GPIO29 (A3)" >> ../HyperSerialPico/firmware/Firmware_for_Adafruit_Feather_RP2040_Scorpio.txt | |
echo "SPI interface is spi1" >> ../HyperSerialPico/firmware/Firmware_for_Adafruit_Feather_RP2040_Scorpio.txt | |
cmake -DOVERRIDE_DATA_PIN=16 -DOVERRIDE_SPI_DATA_PIN=28 -DOVERRIDE_SPI_CLOCK_PIN=26 -DOVERRIDE_SPI_CHIP_SELECT=29 -DOVERRIDE_SPI_INTERFACE=spi1 -DCMAKE_BUILD_TYPE=Release .. | |
cmake --build . | |
zip -j ../HyperSerialPico/firmware/Adafruit_Feather_RP2040_Scorpio.zip ../HyperSerialPico/firmware/* | |
- uses: actions/upload-artifact@v4 | |
name: Upload artifacts (Adafruit_Feather) | |
if: (startsWith(github.event.ref, 'refs/tags') != true) | |
with: | |
name: commit-artifact-Adafruit_Feather | |
path: | | |
rp2040/HyperSerialPico/firmware/*.zip | |
- uses: actions/upload-artifact@v4 | |
name: Upload artifacts (release for Adafruit_Feather) | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: release-artifact-Adafruit_Feather | |
path: | | |
rp2040/HyperSerialPico/firmware/*.zip | |
- name: Build packages for Adafruit ItsyBitsy RP2040 | |
shell: bash | |
run: | | |
cd build | |
rm *.* | |
rm ../HyperSerialPico/firmware/* | |
echo "Neopixel is using GPIO14(OUTPUT_DATA_PIN) on output D5." > ../HyperSerialPico/firmware/Firmware_for_Adafruit_ItsyBitsy_RP2040.txt | |
echo "SPI MOSI->MISO is GPIO28 (A2)" >> ../HyperSerialPico/firmware/Firmware_for_Adafruit_ItsyBitsy_RP2040.txt | |
echo "SPI SCK is GPIO26 (A0)" >> ../HyperSerialPico/firmware/Firmware_for_Adafruit_ItsyBitsy_RP2040.txt | |
echo "SPI CHIP_SELECT is GPIO29 (A3)" >> ../HyperSerialPico/firmware/Firmware_for_Adafruit_ItsyBitsy_RP2040.txt | |
echo "SPI interface is spi1" >> ../HyperSerialPico/firmware/Firmware_for_Adafruit_ItsyBitsy_RP2040.txt | |
cmake -DOVERRIDE_DATA_PIN=14 -DOVERRIDE_SPI_DATA_PIN=28 -DOVERRIDE_SPI_CLOCK_PIN=26 -DOVERRIDE_SPI_CHIP_SELECT=29 -DOVERRIDE_SPI_INTERFACE=spi1 -DCMAKE_BUILD_TYPE=Release .. | |
cmake --build . | |
zip -j ../HyperSerialPico/firmware/Adafruit_ItsyBitsy_RP2040.zip ../HyperSerialPico/firmware/* | |
- uses: actions/upload-artifact@v4 | |
name: Upload artifacts (Adafruit_ItsyBitsy) | |
if: (startsWith(github.event.ref, 'refs/tags') != true) | |
with: | |
name: commit-artifact-Adafruit_ItsyBitsy | |
path: | | |
rp2040/HyperSerialPico/firmware/*.zip | |
- uses: actions/upload-artifact@v4 | |
name: Upload artifacts (release for Adafruit_ItsyBitsy) | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: release-artifact-Adafruit_ItsyBitsy | |
path: | | |
rp2040/HyperSerialPico/firmware/*.zip | |
################################ | |
###### Publish Releases ######## | |
################################ | |
publish: | |
name: Publish Releases | |
if: startsWith(github.event.ref, 'refs/tags') | |
needs: [HyperSpiPico] | |
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 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
pattern: release-artifact-* | |
merge-multiple: true | |
# create draft release and upload artifacts | |
- name: Create draft release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: HyperSPI ${{ env.VERSION }} | |
tag_name: ${{ env.TAG }} | |
files: "artifacts/**" | |
draft: true | |
prerelease: ${{ env.preRelease }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |