Skip to content

Commit f057f9e

Browse files
authored
Merge branch 'main' into generate-libraries-main
2 parents ce0aa34 + 9603796 commit f057f9e

3 files changed

Lines changed: 66 additions & 3 deletions

File tree

.github/workflows/update_librarian_googleapis.yaml

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ jobs:
6868
new_commit=$(go run "github.com/googleapis/librarian/cmd/librarian@${version}" config get sources.googleapis.commit)
6969
echo "new_commit=${new_commit}" >> $GITHUB_OUTPUT
7070
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
7373
run: |
7474
git add librarian.yaml
7575
changed_files=$(git diff --cached --name-only)
@@ -79,8 +79,51 @@ jobs:
7979
else
8080
echo "has_changes=true" >> $GITHUB_OUTPUT
8181
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
82125
- 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'
84127
env:
85128
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
86129
PR_TITLE: "chore: update googleapis commitish to ${{ steps.commit.outputs.short_commit }}"

java-storage/gapic-google-cloud-storage-v2/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,15 @@
9595
</dependency>
9696
</dependencies>
9797
</profile>
98+
<profile>
99+
<id>native</id>
100+
<dependencies>
101+
<dependency>
102+
<groupId>org.junit.vintage</groupId>
103+
<artifactId>junit-vintage-engine</artifactId>
104+
<scope>test</scope>
105+
</dependency>
106+
</dependencies>
107+
</profile>
98108
</profiles>
99109
</project>

java-storage/google-cloud-storage-control/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@
111111
</dependency>
112112
</dependencies>
113113
</profile>
114+
<profile>
115+
<id>native</id>
116+
<dependencies>
117+
<dependency>
118+
<groupId>org.junit.vintage</groupId>
119+
<artifactId>junit-vintage-engine</artifactId>
120+
<scope>test</scope>
121+
</dependency>
122+
</dependencies>
123+
</profile>
114124
</profiles>
115125
<properties>
116126
<maven.compiler.source>8</maven.compiler.source>

0 commit comments

Comments
 (0)