Skip to content
Open
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
49 changes: 46 additions & 3 deletions .github/workflows/update_librarian_googleapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ jobs:
new_commit=$(go run "github.com/googleapis/librarian/cmd/librarian@${version}" config get sources.googleapis.commit)
echo "new_commit=${new_commit}" >> $GITHUB_OUTPUT
echo "short_commit=${new_commit:0:7}" >> $GITHUB_OUTPUT
- name: Detect Changes
id: detect
- name: Detect Changes To Librarian.yaml
id: detect_librarian
run: |
git add librarian.yaml
changed_files=$(git diff --cached --name-only)
Expand All @@ -79,8 +79,51 @@ jobs:
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Install protoc
run: |
set -e
VERSION="33.2"
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"
cd /usr/local
sudo unzip -o /tmp/protoc.zip
protoc --version
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: "maven"
- name: Verify Java and Maven installation
run: |
java -version
if ! command -v mvn &> /dev/null; then
sudo apt-get update && sudo apt-get install -y maven
fi
mvn -version
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: 'pip'
- name: Run librarian install
run: |
go run github.com/googleapis/librarian/cmd/librarian@latest install
echo "$HOME/java_tools/bin" >> $GITHUB_PATH
env:
PYTHONPATH: ${{ github.workspace }}/sdk-platform-java/hermetic_build/library_generation/owlbot
- name: Generate Libraries
if: steps.detect_librarian.outputs.has_changes == 'true'
id: generate
run: |
go run github.com/googleapis/librarian/cmd/librarian@latest generate --all
git add .
changed_files=$(git diff --cached --name-only)
if [[ "${changed_files}" == "" ]]; then
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "No changes in libraries"
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit and Create PR
if: steps.detect.outputs.has_changes == 'true'
if: steps.detect_librarian.outputs.has_changes == 'true' || steps.generate.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
PR_TITLE: "chore: update googleapis commitish to ${{ steps.commit.outputs.short_commit }}"
Expand Down
Loading