-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Java] Replace maven-release-plugin with CI-friendly versions #2603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
99b4d89
fdb2e7d
3cf9da4
2e0b7ef
a8ad1ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -383,11 +383,11 @@ jobs: | |
| if: github.event.inputs.dist-tag != 'unstable' && github.ref == 'refs/heads/main' | ||
| needs: version | ||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
| contents: read | ||
| uses: ./.github/workflows/java-publish-maven.yml | ||
| with: | ||
| releaseVersion: ${{ needs.version.outputs.version }} | ||
| sourceSha: ${{ github.sha }} | ||
| prerelease: ${{ github.event.inputs.dist-tag == 'prerelease' }} | ||
| secrets: inherit | ||
|
|
||
|
|
@@ -485,3 +485,58 @@ jobs: | |
| fi | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Tag Java SDK | ||
| # Reuse a tag only when it identifies the source that was published. | ||
| if: github.event.inputs.dist-tag == 'latest' || github.event.inputs.dist-tag == 'prerelease' | ||
| run: | | ||
| set -euo pipefail | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git fetch --tags origin | ||
| TAG_NAME="java/v${VERSION}" | ||
| if git show-ref --verify --quiet "refs/tags/$TAG_NAME"; then | ||
| TAG_COMMIT=$(git rev-parse --verify "refs/tags/${TAG_NAME}^{commit}") | ||
| if [ "$TAG_COMMIT" != "$SOURCE_SHA" ]; then | ||
| echo "::error::Tag $TAG_NAME points to $TAG_COMMIT, expected $SOURCE_SHA. Refusing to overwrite it." | ||
| exit 1 | ||
| fi | ||
| echo "Tag $TAG_NAME already points to the release source, skipping tag push" | ||
| else | ||
| STATUS=$? | ||
| if [ "$STATUS" -ne 1 ]; then | ||
| echo "::error::Could not inspect tag $TAG_NAME." | ||
| exit "$STATUS" | ||
| fi | ||
| git tag "$TAG_NAME" "$SOURCE_SHA" | ||
| git push origin "refs/tags/$TAG_NAME" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move Java tagging into its own downstream job and make |
||
| echo "Created and pushed tag $TAG_NAME" | ||
| fi | ||
| env: | ||
| VERSION: ${{ needs.version.outputs.version }} | ||
| SOURCE_SHA: ${{ github.sha }} | ||
|
|
||
| deploy-java-site: | ||
| name: Deploy Java documentation site | ||
| needs: [version, github-release] | ||
| runs-on: ubuntu-latest | ||
| permissions: {} | ||
| steps: | ||
| - name: Trigger Java documentation site deploy | ||
| # A failed dispatch can be retried without recreating the GitHub release. | ||
| run: | | ||
| set -euo pipefail | ||
| TAG="java/v${VERSION}" | ||
| PUBLISH_AS_LATEST=true | ||
| if [ "$DIST_TAG" = "prerelease" ]; then | ||
| PUBLISH_AS_LATEST=false | ||
| fi | ||
| echo "Triggering site deployment for version ${VERSION} (tag: ${TAG})" | ||
| gh workflow run deploy-site.yml \ | ||
| --repo github/copilot-sdk-java \ | ||
| -f version="${VERSION}" \ | ||
| -f publish_as_latest="${PUBLISH_AS_LATEST}" \ | ||
| -f monorepo_tag="${TAG}" | ||
| env: | ||
| VERSION: ${{ needs.version.outputs.version }} | ||
| DIST_TAG: ${{ github.event.inputs.dist-tag }} | ||
| GITHUB_TOKEN: ${{ secrets.JAVA_RELEASE_GITHUB_TOKEN }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add
-DskipITshere and to the actual Java release publication command, which also intends to skip tests. The CI merge includes main's Failsafe 3.6.0 upgrade; that version no longer honors-DskipTestsfor integration tests. This new SDK installation step therefore runs integration tests while CLI preparation is skipped, causing the current publication assembly failure and consequentlyJava required. I reproduced Failsafe 3.6.0 running an integration test despite-DskipTestsand confirmed that adding-DskipITsskips it. This is a deterministic interaction with main, not a failure of${revision}versioning or a transient CI issue.