From d70b5c5156858132decfdbae0a1103e6a5cb1345 Mon Sep 17 00:00:00 2001 From: deannagarcia <69992229+deannagarcia@users.noreply.github.com> Date: Fri, 11 Nov 2022 15:39:05 -0800 Subject: [PATCH] Copybara import of the project: -- daab7b111c75818ceb7acd1d75248df8e97c154c by Deanna Garcia : Add update php repo github action -- f4d3f1996d76767efa56443e9a89f946d19aa5d7 by Deanna Garcia : Address comments COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/10839 from deannagarcia:phpGHA 5635586e87bbdb0250307bebb6c02908abcc181a PiperOrigin-RevId: 487933530 --- .github/workflows/update_php_repo.yml | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/update_php_repo.yml diff --git a/.github/workflows/update_php_repo.yml b/.github/workflows/update_php_repo.yml new file mode 100644 index 000000000000..2224cd209e0e --- /dev/null +++ b/.github/workflows/update_php_repo.yml @@ -0,0 +1,45 @@ +name: Update protobuf-php Repo + +on: + push: + tags: + - v[0-9]+.[0-9]+ + - v[0-9]+.[0-9]+-rc[0-9]+ + +jobs: + update-repo: + name: Update PHP Repo + runs-on: ubuntu-latest + steps: + - name: Checkout protobuf-php + uses: actions/checkout@v3 + with: + repository: protocolbuffers/protobuf-php + token: ${{ secrets.BOT_ACCESS_TOKEN }} + - name: Clone protobuf + uses: actions/checkout@v3 + with: + path: protobuf + - name: Configure Git Bot + run: | + git config user.name "Protobuf Team Bot" + git config user.email "protobuf-team-bot@google.com" + - name: Get PHP Version + run: | + unformatted_version=$( cat protobuf/version.json | jq -r '.main.languages.php' ) + version=${unformatted_version/-rc/RC} + version_tag=v$version + echo "VERSION=$version" >> $GITHUB_ENV + echo "VERSION_TAG=$version_tag" >> $GITHUB_ENV + - name: Copy files + run: | + rm -rf src + cp -r protobuf/php/src . + cp protobuf/php/composer.json.dist composer.json + rm -rf protobuf + - name: Push Changes + run: | + git commit -a -m "$VERSION sync" + git push --force origin master + git tag -a $VERSION_TAG -m "Tag release $VERSION_TAG" + git push origin $VERSION_TAG