mirror of
https://github.com/awslabs/aws-crt-php.git
synced 2026-08-18 18:13:09 +00:00
use separate action to generate release artifacts
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
name: Prepare PECL package
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
release_notes:
|
||||||
|
description: "The release nodes for the version."
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-version:
|
||||||
|
runs-on: ubuntu-20.04 # latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout Source
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Get Version
|
||||||
|
id: get-version
|
||||||
|
run: |
|
||||||
|
version_with_v=$(git describe --tags --abbrev=0)
|
||||||
|
VERSION=$(echo ${version_with_v} | cut -f2 -dv)
|
||||||
|
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Prepare Package Script
|
||||||
|
env:
|
||||||
|
Notes: ${{ github.event.inputs.release_notes }}
|
||||||
|
# Update the version in code and generate the package.
|
||||||
|
run: |
|
||||||
|
git checkout PECL-release
|
||||||
|
python3 dev-scripts/prepare_pecl_release.py --name aws-crt --user aws-crt --email [email protected] --version ${{ steps.get-version.outputs.VERSION }} --notes $Notes
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: pecl_package_${{ steps.get-version.outputs.VERSION }}
|
||||||
|
path: awscrt-${{ steps.get-version.outputs.VERSION }}.tgz
|
||||||
|
if-no-files-found: error
|
||||||
@@ -16,6 +16,8 @@ jobs:
|
|||||||
package:
|
package:
|
||||||
name: Prepare package
|
name: Prepare package
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write # allow push
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
@@ -29,18 +31,24 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Prepare Package Script
|
- name: Update Version
|
||||||
id: prepare-package
|
|
||||||
# Update the version in code and generate the package.
|
|
||||||
run: |
|
run: |
|
||||||
version_with_v=$(git describe --tags --abbrev=0)
|
version_with_v=$(git describe --tags --abbrev=0)
|
||||||
VERSION=$(echo ${version_with_v} | cut -f2 -dv)
|
VERSION=$(echo ${version_with_v} | cut -f2 -dv)
|
||||||
sed -i "s/#define CRT_VERSION .*/#define CRT_VERSION \"$VERSION\"/g" ext/crt.c
|
sed -i "s/#define CRT_VERSION .*/#define CRT_VERSION \"$VERSION\"/g" ext/crt.c
|
||||||
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
|
- name: Commit
|
||||||
uses: actions/upload-artifact@v3
|
run: |
|
||||||
|
git config --local user.email "[email protected]"
|
||||||
|
git config --local user.name "GitHub Action"
|
||||||
|
git add --force ext/crt.c
|
||||||
|
git commit --message="update version"
|
||||||
|
|
||||||
|
- name: Push to PECL-release branch
|
||||||
|
uses: ad-m/[email protected]
|
||||||
with:
|
with:
|
||||||
name: pecl_package_${{ steps.prepare-package.outputs.VERSION }}
|
github_token: ${{ github.token }}
|
||||||
path: awscrt-${{ steps.prepare-package.outputs.VERSION }}.tgz
|
branch: PECL-release
|
||||||
|
# Force push so that `PECL-release` branch always looks like `main`,
|
||||||
|
# but with 1 additional "update version" commit.
|
||||||
|
force: true
|
||||||
|
|||||||
Reference in New Issue
Block a user