Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Release
name: Release Build Check

on:
push:
# Run a real release on pushes to tags like v1.0, v2.3.4, etc.
tags:
- "v*"
# Run a dry-run on pushes to any branch
# Run a release build dry-run on pushes to any branch to verify
# that the release build still succeeds. Actual releases are driven
# by the secure release pipeline in
# databricks/secure-public-registry-releases-eng via workflow_dispatch
# against tagging.yml and package.yml.
branches:
- "**"

Expand All @@ -15,8 +16,7 @@ permissions:

jobs:
publish:
# Dynamically set the job name based on the trigger
name: ${{ startsWith(github.ref, 'refs/tags/') && 'Publish Release' || 'Run Release Dry-Run' }}
name: Run Release Dry-Run

runs-on:
group: databricks-protected-runner-group
Expand Down Expand Up @@ -82,42 +82,9 @@ jobs:
</settings>
EOF

# This step runs ONLY on branch pushes (dry-run)
- name: Run Release Dry-Run (Verify)
if: "!startsWith(github.ref, 'refs/tags/')"
run: mvn -Prelease -DskipTests=true --batch-mode verify
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

# This step runs ONLY on tag pushes (real release)
- name: Publish to Maven Central Repository (Deploy)
if: "startsWith(github.ref, 'refs/tags/')"
run: mvn -Prelease -DskipTests=true --batch-mode deploy
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

- name: Write release notes to file
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
RELEASE_NOTES_DIR=/tmp/release-notes
mkdir -p "$RELEASE_NOTES_DIR"
RELEASE_NOTES_FILE="$RELEASE_NOTES_DIR/release-notes.md"
git for-each-ref --format='%(body)' ${{ github.ref }} > "$RELEASE_NOTES_FILE"
echo "Release notes file: $RELEASE_NOTES_FILE"
echo "Release notes contents:"
cat "$RELEASE_NOTES_FILE"
else
echo "Not a release tag, skipping release notes"
fi

# This step also runs ONLY on tag pushes (real release)
- name: Create GitHub release
if: "startsWith(github.ref, 'refs/tags/')"
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: databricks-sdk-java/target/*.jar
body_path: /tmp/release-notes/release-notes.md
Loading