Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the generator #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions .github/workflows/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
version:
description: "version"
required: true
default: "v14"
default: "v15"

jobs:
build:
Expand All @@ -15,7 +15,8 @@ jobs:
image: alpine:latest
env:
VERSION: ${{ github.event.inputs.version }}
PUBLISH_PKG: github.com/shenzhencenter/google-ads-pb
BRANCH_NAME: ${{ github.event.inputs.version }}
PUBLISH_PKG: github.com/Optable/google-ads-pb
INPUT_PATH: /googleapis
OUTPUT_PATH: ~/go/src/google-ads-pb
ADSLIB_PATH: /googleapis/google/ads/googleads/${{ github.event.inputs.version }}
Expand All @@ -34,10 +35,11 @@ jobs:

- name: Clone repositories
run: |
git clone --branch=develop https://$GITHUB_ACTOR_ID:${{ secrets.GITHUB_TOKEN }}@github.com/shenzhencenter/google-ads-pb.git $OUTPUT_PATH
git clone --depth=1 --branch=master https://github.com/googleapis/googleapis.git $INPUT_PATH
git clone https://$GITHUB_ACTOR_ID:${{ secrets.GITHUB_TOKEN }}@github.com/Optable/google-ads-pb.git $OUTPUT_PATH
git -C $OUTPUT_PATH checkout -b $BRANCH_NAME
git clone --depth=1 https://github.com/googleapis/googleapis.git $INPUT_PATH
if [ ! -d $INPUT_PATH/google/protobuf ]; then
git clone --depth=1 --branch=main https://github.com/protocolbuffers/protobuf.git /protobuf
git clone --depth=1 https://github.com/protocolbuffers/protobuf.git /protobuf
ln -s /protobuf/src/google/protobuf $INPUT_PATH/google/protobuf
fi

Expand Down Expand Up @@ -77,7 +79,7 @@ jobs:
run: |
cd $OUTPUT_PATH
if [ ! -f go.mod ]; then
go mod init github.com/shenzhencenter/google-ads-pb
go mod init github.com/Optable/google-ads-pb
fi
go mod tidy
go fmt ./...
Expand All @@ -87,11 +89,15 @@ jobs:
run: |
cd $OUTPUT_PATH
if [ -z "$(git status --porcelain)" ]; then
echo "==> No changes"
echo "==> No changes to commit"
exit 0
fi
git add .
git config user.email "[email protected]"
git config user.name "GitHub Action"
git commit -m "feat: updated by action, $(date)"
git push origin develop
echo "==> Committing changes"

git config user.name "GitHub Actions Bot"
git config user.email "<>"

git add .
git commit -m "Auto-generated client update for version $VERSION"
git push origin $BRANCH_NAME
echo "==> Changes have been pushed"
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.20"
go-version: "1.21.0"

- name: Build
run: go mod tidy && go build -v ./...
Loading