Attempt at fixing publish #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: snapshot_release | |
| on: | |
| repository_dispatch: | |
| types: [ trigger-snapshot-release ] | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - support-system-message-transformer | |
| jobs: | |
| snapshot_release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| server-id: github | |
| server-username: GITHUB_ACTOR | |
| server-password: GITHUB_TOKEN | |
| - name: Override groupId to com.bridge | |
| run: | | |
| # Add an explicit <groupId>com.bridge</groupId> to the starter POM | |
| # (right after <artifactId>), so it no longer inherits dev.langchain4j | |
| sed -i '/<artifactId>langchain4j-spring-boot-starter<\/artifactId>/a\ <groupId>com.bridge</groupId>' \ | |
| langchain4j-spring-boot-starter/pom.xml | |
| # Remove the entire central-publishing-maven-plugin <plugin> block from the parent POM | |
| # (it has extensions=true which hijacks the deploy phase away from maven-deploy-plugin) | |
| python3 -c " | |
| import re | |
| with open('pom.xml', 'r') as f: | |
| content = f.read() | |
| content = re.sub(r'\s*<plugin>\s*<groupId>org\.sonatype\.central</groupId>.*?</plugin>', '', content, flags=re.DOTALL) | |
| with open('pom.xml', 'w') as f: | |
| f.write(content) | |
| " | |
| - name: snapshot_release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Install the parent POM locally (non-recursive) so the starter can resolve it | |
| mvn -B -N install -DskipTests | |
| # Deploy only the starter submodule using the standard maven-deploy-plugin | |
| mvn -B -U --fail-at-end -DskipTests -DskipITs deploy \ | |
| -pl langchain4j-spring-boot-starter \ | |
| -DaltDeploymentRepository=github::https://maven.pkg.github.com/${{ github.repository }} |