diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e9a73fa --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ + +name: Release PECL Preparation + +# on: +# release: +# types: [published] +# workflow_dispatch: + +# TO test +on: + push: + branches-ignore: + - 'main' + +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: + submodules: recursive + + - name: Get release tag + uses: awslabs/aws-crt-builder/.github/actions/release-tag@main + id: tag + + - name: Prepare Package Script + # Update the version in code and generate the package. + run: | + sed -i "s/#define CRT_VERSION \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/#define CRT_VERSION \"${{ steps.tag.outputs.release_tag }}\"/g" ext/crt.c + dev-scripts/prepare_release.sh --name aws-crt --user aws-crt --email aws-sdk-common-runtime@amazon.com --version ${{ steps.tag.outputs.release_tag }} --notes NOTES + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: pecl_package_${{ steps.tag.outputs.release_tag }} + path: awscrt-${{ steps.tag.outputs.release_tag }}.tgz \ No newline at end of file diff --git a/ext/crt.c b/ext/crt.c index b71dd79..eea20de 100644 --- a/ext/crt.c +++ b/ext/crt.c @@ -263,6 +263,8 @@ static PHP_GINIT_FUNCTION(awscrt) { awscrt_globals->log_level = 0; } +#define CRT_VERSION “0.1.0” + zend_module_entry awscrt_module_entry = { STANDARD_MODULE_HEADER, "awscrt", @@ -272,7 +274,7 @@ zend_module_entry awscrt_module_entry = { NULL, /* RINIT */ NULL, /* RSHUTDOWN */ NULL, /* MINFO */ - NO_VERSION_YET, + CRT_VERSION, PHP_MODULE_GLOBALS(awscrt), PHP_GINIT(awscrt), NULL, /* GSHUTDOWN */