mirror of
https://github.com/awslabs/aws-crt-php.git
synced 2026-08-18 18:13:09 +00:00
55 lines
1.3 KiB
YAML
55 lines
1.3 KiB
YAML
|
|
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
|
|
permissions:
|
|
contents: write # allow push
|
|
|
|
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: Update Version
|
|
run: |
|
|
version_with_v=$(git describe --tags --abbrev=0)
|
|
VERSION=$(echo ${version_with_v} | cut -f2 -dv)
|
|
sed -i "s/#define CRT_VERSION .*/#define CRT_VERSION \"$VERSION\"/g" ext/crt.c
|
|
|
|
- name: Commit
|
|
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:
|
|
github_token: ${{ github.token }}
|
|
branch: PECL-release
|
|
# Force push so that `PECL-release` branch always looks like `main`,
|
|
# but with 1 additional "update version" commit.
|
|
force: true
|