|
68 | 68 | new_commit=$(go run "github.com/googleapis/librarian/cmd/librarian@${version}" config get sources.googleapis.commit) |
69 | 69 | echo "new_commit=${new_commit}" >> $GITHUB_OUTPUT |
70 | 70 | echo "short_commit=${new_commit:0:7}" >> $GITHUB_OUTPUT |
71 | | - - name: Detect Changes |
72 | | - id: detect |
| 71 | + - name: Detect Changes To Librarian.yaml |
| 72 | + id: detect_librarian |
73 | 73 | run: | |
74 | 74 | git add librarian.yaml |
75 | 75 | changed_files=$(git diff --cached --name-only) |
|
79 | 79 | else |
80 | 80 | echo "has_changes=true" >> $GITHUB_OUTPUT |
81 | 81 | fi |
| 82 | + - name: Install protoc |
| 83 | + run: | |
| 84 | + set -e |
| 85 | + VERSION="33.2" |
| 86 | + curl -fsSL --retry 5 --retry-delay 15 -o /tmp/protoc.zip "https://github.com/protocolbuffers/protobuf/releases/download/v$VERSION/protoc-$VERSION-linux-x86_64.zip" |
| 87 | + cd /usr/local |
| 88 | + sudo unzip -o /tmp/protoc.zip |
| 89 | + protoc --version |
| 90 | + - uses: actions/setup-java@v4 |
| 91 | + with: |
| 92 | + java-version: "17" |
| 93 | + distribution: "temurin" |
| 94 | + cache: "maven" |
| 95 | + - name: Verify Java and Maven installation |
| 96 | + run: | |
| 97 | + java -version |
| 98 | + if ! command -v mvn &> /dev/null; then |
| 99 | + sudo apt-get update && sudo apt-get install -y maven |
| 100 | + fi |
| 101 | + mvn -version |
| 102 | + - uses: actions/setup-python@v5 |
| 103 | + with: |
| 104 | + python-version: "3.12" |
| 105 | + cache: 'pip' |
| 106 | + - name: Run librarian install |
| 107 | + run: | |
| 108 | + go run github.com/googleapis/librarian/cmd/librarian@latest install |
| 109 | + echo "$HOME/java_tools/bin" >> $GITHUB_PATH |
| 110 | + env: |
| 111 | + PYTHONPATH: ${{ github.workspace }}/sdk-platform-java/hermetic_build/library_generation/owlbot |
| 112 | + - name: Generate Libraries |
| 113 | + if: steps.detect_librarian.outputs.has_changes == 'true' |
| 114 | + id: generate |
| 115 | + run: | |
| 116 | + go run github.com/googleapis/librarian/cmd/librarian@latest generate --all |
| 117 | + git add . |
| 118 | + changed_files=$(git diff --cached --name-only) |
| 119 | + if [[ "${changed_files}" == "" ]]; then |
| 120 | + echo "has_changes=false" >> $GITHUB_OUTPUT |
| 121 | + echo "No changes in libraries" |
| 122 | + else |
| 123 | + echo "has_changes=true" >> $GITHUB_OUTPUT |
| 124 | + fi |
82 | 125 | - name: Commit and Create PR |
83 | | - if: steps.detect.outputs.has_changes == 'true' |
| 126 | + if: steps.detect_librarian.outputs.has_changes == 'true' || steps.generate.outputs.has_changes == 'true' |
84 | 127 | env: |
85 | 128 | GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }} |
86 | 129 | PR_TITLE: "chore: update googleapis commitish to ${{ steps.commit.outputs.short_commit }}" |
|
0 commit comments