Unverified Commit 01093482 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Add script to update version number, new header (#506)

Define ARDUINO_PICO_MAJOR/_MINOR/_REVISION for app use and update the
Platform.IO and Arduino files for a new release version.

Fixes #309
Fixes #487
parent da215aec
......@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include "stdlib_noniso.h" // Wacky deprecated AVR compatibility functions
#include "RP2040Version.h"
#include "api/ArduinoAPI.h"
#include "api/itoa.h" // ARM toolchain doesn't provide itoa etc, provide them
#include <pins_arduino.h>
......
#pragma once
#define ARDUINO_PICO_MAJOR 1
#define ARDUINO_PICO_MINOR 13
#define ARDUINO_PICO_REVISION 0
#define ARDUINO_PICO_VERSION_STR "1.13.0"
{
"name": "framework-arduinopico",
"version": "1.11200.0",
"version": "1.11300.0",
"description": "Arduino Wiring-based Framework (RPi Pico RP2040)",
"keywords": [
"framework",
......
Publishing New Releases
=======================
First, update the version number throughout the repo and push the change:
./tools/makever.py --version X.Y.Z
git commit -a -m "Update version"
git push
GitHub CI Actions are used to automatically build a draft package whenever a tag is pushed to repo:
git tag X.Y.Z
......
......@@ -20,7 +20,7 @@
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Raspberry Pi RP2040 Boards
version=1.12.0
version=1.13.0
runtime.tools.pqt-gcc.path={runtime.platform.path}/system/arm-none-eabi
runtime.tools.pqt-python3.path={runtime.platform.path}/system/python3
......
......@@ -30,6 +30,10 @@ as necessary to add any add'l fields or menus required. Used because the
`boards.txt` file is very repetitive and it's safer to generate with code
than by hand.
## makever.py
Updates the version info prior to a release in platform.txt, package.json,
and the version header. Run from root of the repo.
## libpico/make-libpico.sh
Builds the libpico.a file as well as the bootloader stage2 binaries.
Run whenever the pico-sdk is updated.
#!/usr/bin/env python3
import sys
import struct
import subprocess
import re
import os
import os.path
import argparse
import time
import shutil
def main():
parser = argparse.ArgumentParser(description='Version updater')
parser.add_argument('-v', '--version', action='store', required=True, help='Version in X.Y.Z form')
args = parser.parse_args()
major, minor, sub = args.version.split(".")
# Silly way to check for integer x.y.z
major = int(major)
minor = int(minor)
sub = int(sub)
# platform.txt
with open("platform.txt", "r") as fin:
with open("platform.txt.new", "w") as fout:
for l in fin:
if l.startswith("version="):
l = "version=" + str(args.version) + "\n"
fout.write(l);
shutil.move("platform.txt.new", "platform.txt")
# package.json
with open("package.json", "r") as fin:
with open("package.json.new", "w") as fout:
for l in fin:
if l.startswith(' "version": '):
l = l.split(":")[0]
l = l + ': "1.' + str(major) + "{:02d}".format(minor) + "{:02d}".format(sub) + '.0",' + "\n"
fout.write(l);
shutil.move("package.json.new", "package.json")
# cores/rp2040/RP2040Version.h
with open("cores/rp2040/RP2040Version.h", "w") as fout:
fout.write("#pragma once\n")
fout.write("#define ARDUINO_PICO_MAJOR " + str(major) + "\n")
fout.write("#define ARDUINO_PICO_MINOR " + str(minor) + "\n")
fout.write("#define ARDUINO_PICO_REVISION " + str(sub) + "\n")
fout.write('#define ARDUINO_PICO_VERSION_STR "' + str(args.version) + '"' + "\n")
main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment