-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
90 additions
and
34 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
name: Release PECL Preparation | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
package: | ||
name: Prepare package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.0' | ||
|
||
- name: Checkout Source | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
- name: Prepare Package Script | ||
id: prepare-package | ||
# Update the version in code and generate the package. | ||
run: | | ||
version_with_v=$(git describe --tags --abbrev=0) | ||
VERSION=$(echo ${version_with_v} | cut -f2 -dv) | ||
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT | ||
python3 dev-scripts/prepare_pecl_release.py --name aws-crt --user aws-crt --email [email protected] --version ${VERSION} | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pecl_package_${{ steps.prepare-package.outputs.VERSION }} | ||
path: awscrt-${{ steps.prepare-package.outputs.VERSION }}.tgz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,6 +179,7 @@ fabric.properties | |
.deps | ||
.libs/ | ||
build/ | ||
cmake_build/ | ||
configure.in | ||
configure.ac | ||
configure.bat | ||
|
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,11 @@ | |
import subprocess | ||
import xml.dom.minidom | ||
import sys | ||
import re | ||
|
||
# get the github tag without the leading 'v' | ||
git_tag = subprocess.run( | ||
["git", "describe", "--tags", "--abbrev=0"], capture_output=True).stdout.decode('utf-8').strip()[1:] | ||
|
||
|
||
parser = argparse.ArgumentParser(description='PECL Package generator') | ||
|
@@ -12,7 +17,7 @@ | |
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) | ||
"--version", help="Version number of the package", default=git_tag) | ||
parser.add_argument( | ||
"--notes", help="Release notes for the package", default='New release') | ||
args = parser.parse_args() | ||
|
@@ -27,6 +32,9 @@ | |
TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) | ||
WORK_DIR = os.path.join(TOOLS_DIR, '..') | ||
|
||
print(f'using version: {VERSION}') | ||
print(f'using notes: {NOTES}') | ||
|
||
|
||
def run(args): | ||
print(f"$ {subprocess.list2cmdline(args)}") | ||
|
@@ -39,6 +47,17 @@ def run(args): | |
|
||
run(['git', 'submodule', 'update', '--init', '--recursive']) | ||
|
||
# replace the version number in the ext/crt.c file | ||
data = "" | ||
with open("ext/crt.c", "r") as c_file: | ||
for line in c_file: | ||
line = re.sub("#define CRT_VERSION .*", | ||
f"#define CRT_VERSION \"{VERSION}\"", line) | ||
data += line | ||
with open("ext/crt.c", "w") as c_file: | ||
c_file.write(data) | ||
|
||
|
||
try: | ||
run(['python3', f'{TOOLS_DIR}/prepare_pecl_package_xml.py', '--name', NAME, '--user', USER, | ||
'--email', EMAIL, '--version', VERSION, '--notes', NOTES]) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
*.so | ||
api.h | ||
awscrt.stub.php |
File renamed without changes.
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