forked from protocolbuffers/protobuf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-- daab7b1 by Deanna Garcia <deannagarcia@google.com>: Add update php repo github action -- f4d3f19 by Deanna Garcia <deannagarcia@google.com>: Address comments COPYBARA_INTEGRATE_REVIEW=protocolbuffers#10839 from deannagarcia:phpGHA 5635586 PiperOrigin-RevId: 487933530
- Loading branch information
1 parent
43e22d5
commit d70b5c5
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |