mirror of
https://github.com/awslabs/aws-crt-php.git
synced 2026-08-18 01:57:13 +00:00
update helper scripts and more
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(description='PECL Package generator')
|
||||
parser.add_argument("--name", help="Name of the package", required=True)
|
||||
parser.add_argument(
|
||||
"--user", help="Username of the package maintainer", required=True)
|
||||
parser.add_argument(
|
||||
"--email", help="Email address of the package maintainer", default='[email protected]')
|
||||
parser.add_argument(
|
||||
"--version", help="Version number of the package", required=True)
|
||||
parser.add_argument(
|
||||
"--notes", help="Release notes for the package", default='New release')
|
||||
args = parser.parse_args()
|
||||
|
||||
PACKAGE = 'awscrt'
|
||||
NAME = args.name
|
||||
USER = args.user
|
||||
EMAIL = args.email
|
||||
VERSION = args.version
|
||||
NOTES = args.notes
|
||||
|
||||
TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
WORK_DIR = os.path.join(TOOLS_DIR, '..')
|
||||
|
||||
subprocess.run(['python3', f'{TOOLS_DIR}/cleanup_build.py'], check=True)
|
||||
|
||||
os.chdir(WORK_DIR)
|
||||
|
||||
subprocess.run(['git', 'submodule', 'update',
|
||||
'--init', '--recursive'], check=True)
|
||||
|
||||
subprocess.run(['python3', f'{TOOLS_DIR}/prepare_pecl_package_xml.py', '--name', NAME, '--user', USER,
|
||||
'--email', EMAIL, '--version', VERSION, '--notes', NOTES], check=True)
|
||||
try:
|
||||
with open('package.xml', 'r') as f:
|
||||
package_xml = f.read()
|
||||
subprocess.run(['tidy', '-xml', '-m', '-i', 'package.xml'], check=True)
|
||||
subprocess.run(['pear', 'package-validate'], check=True)
|
||||
subprocess.run(['pear', 'package'], check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f'ERROR PROCESSING review package.xml: {e}')
|
||||
exit(1)
|
||||
|
||||
print(f'Size of {PACKAGE}-{VERSION}.tgz: {os.path.getsize(f"{PACKAGE}-{VERSION}.tgz") / 1024 / 1024:.2f} MB')
|
||||
Reference in New Issue
Block a user