Skip to content

Commit

Permalink
Use mvn install-file
Browse files Browse the repository at this point in the history
  • Loading branch information
deannagarcia committed Jul 26, 2024
1 parent cd70033 commit c78ef3c
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions .github/workflows/test_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,38 +99,23 @@ jobs:
run: |
mv ${{ steps.build-protoc.outputs.protoc }} protoc
sudo rm -rf _build
- name: Generate pom.xml files from the template
- name: Generate maven artifacts with bazel and install using maven
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:11-1fdbb997433cb22c1e49ef75ad374a8d6bb88702
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: java_linux/11
bash: |
bazel build //java/core:core_mvn-pom //java/core:lite_mvn-pom //java/kotlin-lite:kotlin-lite_mvn-pom //java/kotlin:kotlin_mvn-pom //java/util:util_mvn-pom
mkdir -p generatedPoms
cp bazel-bin/java/core/core_mvn-pom.xml generatedPoms/core_mvn-pom.xml
cp bazel-bin/java/core/lite_mvn-pom.xml generatedPoms/lite_mvn-pom.xml
cp bazel-bin/java/kotlin-lite/kotlin-lite_mvn-pom.xml generatedPoms/kotlin-lite_mvn-pom.xml
cp bazel-bin/java/kotlin/kotlin_mvn-pom.xml generatedPoms/kotlin_mvn-pom.xml
cp bazel-bin/java/util/util_mvn-pom.xml generatedPoms/util_mvn-pom.xml
- name: Copy the generated pom.xml files to a copy of the java repository
run: |
cp -r java testMaven
cp -f generatedPoms/core_mvn-pom.xml testMaven/core/pom.xml
cp -f generatedPoms/lite_mvn-pom.xml testMaven/lite/pom.xml
cp -f generatedPoms/kotlin-lite_mvn-pom.xml testMaven/kotlin-lite/pom.xml
cp -f generatedPoms/kotlin_mvn-pom.xml testMaven/kotlin/pom.xml
cp -f generatedPoms/util_mvn-pom.xml testMaven/util/pom.xml
- name: Install snapshot version locally (using generated pom.xml)
run: |
mvn -e -B -Dhttps.protocols=TLSv1.2 install -Dmaven.test.skip=true
working-directory: testMaven
bazel build //java:release
mvn install:install-file -Dfile=bazel-bin/java/core/core_mvn-project.jar -DpomFile=bazel-bin/java/core/core_mvn-pom.xml
mvn install:install-file -Dfile=bazel-bin/java/core/lite_mvn-project.jar -DpomFile=bazel-bin/java/core/lite_mvn-pom.xml
mvn install:install-file -Dfile=bazel-bin/java/kotlin-lite/kotlin-lite_mvn-project.jar -DpomFile=bazel-bin/java/kotlin-lite/kotlin-lite_mvn-pom.xml
mvn install:install-file -Dfile=bazel-bin/java/kotlin/kotlin_mvn-project.jar -DpomFile=bazel-bin/java/kotlin/kotlin_mvn-pom.xml
mvn install:install-file -Dfile=bazel-bin/java/util/util_mvn-project.jar -DpomFile=bazel-bin/java/util/util_mvn-pom.xml
- name: Validate Protobuf BOM
uses: googleapis/java-cloud-bom/tests/validate-bom@fd56f04bb0bc581776a74031591f0b3bc5e7920a # v26.13.0
with:
bom-path: testMaven/bom/pom.xml
bom-path: java/bom/pom.xml
- name: Clean up
run: |
sudo rm -rf _build
sudo rm -rf generatedPoms
sudo rm -rf testMaven

0 comments on commit c78ef3c

Please sign in to comment.