element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Code Exchange
  • Technologies
  • More
Code Exchange
Blog GitHub: automate Raspberry Pico project (nightly) release GitHub Actions
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Code Exchange to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 5 Aug 2024 4:43 PM Date Created
  • Views 665 views
  • Likes 5 likes
  • Comments 0 comments
  • github
  • c++
  • teseo_c++
Related
Recommended

GitHub: automate Raspberry Pico project (nightly) release GitHub Actions

Jan Cumps
Jan Cumps
5 Aug 2024

In  GitHub: automate Raspberry Pico project build verification with GitHub Actions , I made GitHub build a project. I'm using an Action to check out branches and build them, upon a GitHub event.

In this post, I create a GitHub action that will upload firmware to a GitHub release when changes are accepted on the development branch. I called it "nightly build", because my original intention was to run this once every night on the development branch sources. But at this moment, I made it trigger on "acceptance of code into the development branch" instead.

The result is that whenever the development branch manager accepts a pull request for that branch, the GitHub action is executed. And interested parties immediately have access to the firmware. They can drag-drop it onto their Pico.

image

Trigger Options

Initially, I wanted to have two triggers for executing the job: on demand, and daily, based on a cron schedule. But I'm not expecting daily (or even less frequent) changes once this project matures. Running the build every day (even though it is free for public projects) will burn calories. So I changed my mind, and replaced (commented out) the cron trigger. It will now run when changes are merged with the development branch.

name: Build on ubuntu against pico-sdk develop, and deploy to github prerelease
on:
#  schedule:
#    - cron: '0 1 * * *'
  workflow_dispatch:
  push:
    branches:
      - 'develop'

How is it different from the build verification action?

I first designed GitHub: automate Raspberry Pico project build verification with GitHub Actions . That GitHub action will validate that new contributions will not break the code base, before the code is merged. And it is designed to work with every protected branch. The outcome is: true if the code builds. It's used as a guard for pull requests. If your code doesn't build correctly, the pull request will not merge.

The GitHub action in this post is different. It's a reaction to the successful merge of a pull request that targets the development branch. It doesn't guard or block anything. But it provides users with the latest "approved by the development manager" firmware. 

Upload assets to a GitHub release via Actions

It's explained in the readme of the action that I use: pyTooling/Actions/releaser. Prerequisite is that you create a release (or as I did: pre-release) for your GitHub project first.

Here's the checkout and upload specific code. The rest is shared with the build.yml action I referred to above.

# ...

      - name: Checkout pico_gps_teseo
        uses: actions/checkout@v4
        with:
          path: pico_gps_teseo
          ref: develop
          submodules: true

" ...

      - name: Deploy Nightly Development Release
        uses: pyTooling/Actions/releaser@r0
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          tag: nightly_development
          files: /home/runner/work/pico_gps_teseo/pico_gps_teseo/pico_gps_teseo/build/pico_gps_teseo_*.uf2

My build generates several .uf2 firmware binaries. An I2C and UART version of each of the examples in my project. How I do that, is a subject for follow-up post  CMake and Raspberry Pico: generate multiple firmware binaries for the same code base .

Link to all posts.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube