Update SDK to b7f0bdef8060a7daec78568f87fae44773f598c5 #536
Workflow file for this run
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: Release | |
| 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 | |
| branches: | |
| - "**" | |
| jobs: | |
| publish: | |
| # Dynamically set the job name based on the trigger | |
| name: ${{ startsWith(github.ref, 'refs/tags/') && 'Publish Release' || 'Run Release Dry-Run' }} | |
| runs-on: | |
| group: databricks-deco-testing-runner-group | |
| labels: ubuntu-latest-deco | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Set up Java for publishing to Maven Central Repository | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: 8 | |
| server-id: central | |
| distribution: "adopt" | |
| server-username: MAVEN_CENTRAL_USERNAME | |
| server-password: MAVEN_CENTRAL_PASSWORD | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| gpg-passphrase: GPG_PASSPHRASE | |
| # 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@v1 | |
| with: | |
| files: databricks-sdk-java/target/*.jar | |
| body_path: /tmp/release-notes/release-notes.md |