Skip to content
Merged
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
24 changes: 11 additions & 13 deletions .github/workflows/lt-reports-cd.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: lt-reports-cd

# Publishes the Karate report-integration fatjar to GitHub Packages on every
# merge into lt-reports. The post-processing service (LambdatestIncPrivate/
# hyperexecute-postprocessing-service) downloads it from a fixed coordinate at
# Docker build time, so there is nothing to version-bump or rename by hand:
# every merge overwrites the same coordinate, mirroring how the extent report
# jar is published (extentnativereports-1.10-stage).
# merge into lt-reports, under coordinate:
#
# coordinate: com.lambdatest:karate-reports:lt-reports
# url: https://maven.pkg.github.com/LambdaTest/karate/com/lambdatest/karate-reports/lt-reports/karate-reports-lt-reports.jar
# com.lambdatest:karate-reports:${project.version}.${lt.patch.version}
#
# project.version tracks upstream karate; lt.patch.version is a LambdaTest-fork
# counter in the root pom that must be bumped on each republish.

on:
push:
Expand Down Expand Up @@ -62,25 +60,25 @@ jobs:
test -f "${FATJAR}" || { echo "fatjar not found at ${FATJAR}"; ls -lh karate-core/target; exit 1; }
ls -lh "${FATJAR}"

# Deploy the fatjar to GitHub Packages under a fixed coordinate. deploy-file
# is used (instead of a plain deploy) so the karate-parent release version
# (1.5.x, used for Maven Central) is never touched. Only runs on lt-reports
# (not workflow_dispatch from other branches) so the package is published
# solely from merges into lt-reports.
# deploy-file (not a plain deploy) keeps the karate-parent release version
# untouched. Guarded to lt-reports so only merges publish, never dispatch.
- name: publish to GitHub Packages
if: github.ref == 'refs/heads/lt-reports'
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
KARATE_VERSION="$(mvn -q -DforceStdout -f karate-core/pom.xml help:evaluate -Dexpression=project.version)"
LT_PATCH_VERSION="$(mvn -q -DforceStdout -f karate-core/pom.xml help:evaluate -Dexpression=lt.patch.version)"
PUBLISH_VERSION="${KARATE_VERSION}.${LT_PATCH_VERSION}"
echo "Publishing karate-reports version: ${PUBLISH_VERSION}"
FATJAR="karate-core/target/karate-${KARATE_VERSION}.jar"
mvn -B -ntp deploy:deploy-file \
--settings .github/settings.xml \
-Dfile="${FATJAR}" \
-DgroupId=com.lambdatest \
-DartifactId=karate-reports \
-Dversion=lt-reports \
-Dversion="${PUBLISH_VERSION}" \
-Dpackaging=jar \
-DrepositoryId=github \
-Durl=https://maven.pkg.github.com/LambdaTest/karate
3 changes: 0 additions & 3 deletions .github/workflows/lt-reports-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ name: lt-reports-ci
# on PRs before they reach the publish-on-merge workflow.

on:
push:
branches:
- lt-reports
pull_request:
branches:
- lt-reports
Expand Down
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
</developers>

<properties>
<!-- LambdaTest fork patch counter, kept separate from the upstream-tracking
<version> above. lt-reports-cd publishes ${project.version}.${lt.patch.version};
bump this on every change that needs a republish. -->
<lt.patch.version>1</lt.patch.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<maven.compiler.version>3.13.0</maven.compiler.version>
Expand Down
Loading