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 "action@github.com" 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/github-push-action@v0.6.0 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