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
This commit is contained in:
parent
da215aecd4
commit
01093482e7
7 changed files with 68 additions and 2 deletions
|
|
@ -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>
|
||||
|
|
|
|||
5
cores/rp2040/RP2040Version.h
Normal file
5
cores/rp2040/RP2040Version.h
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#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"
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "framework-arduinopico",
|
||||
"version": "1.11200.0",
|
||||
"version": "1.11300.0",
|
||||
"description": "Arduino Wiring-based Framework (RPi Pico RP2040)",
|
||||
"keywords": [
|
||||
"framework",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
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.
|
||||
|
|
|
|||
50
tools/makever.py
Executable file
50
tools/makever.py
Executable file
|
|
@ -0,0 +1,50 @@
|
|||
#!/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()
|
||||
Loading…
Reference in a new issue