release #37
This file contains 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 | |
permissions: | |
checks: write | |
pull-requests: write | |
packages: write | |
deployments: write | |
contents: write | |
id-token: write | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag' | |
required: true | |
default: 'refs/tags/v0.0.0' | |
upload_to_maven: | |
description: 'Upload to Maven' | |
required: false | |
default: false | |
github_release: | |
description: 'Create Github release' | |
required: false | |
default: false | |
upload_to_azure: | |
description: 'Upload to Azure storage' | |
required: false | |
default: false | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
environment: build | |
strategy: | |
matrix: | |
java: [ '8' ] | |
name: Java ${{ matrix.java }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.tag || github.ref }} | |
- name: Azure login | |
uses: azure/login@v2 | |
with: | |
client-id: ${{ secrets.APP_ID }} | |
tenant-id: ${{ secrets.TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Setup java ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: ${{ matrix.java }} | |
cache: 'maven' | |
- name: Run the Maven verify phase | |
run: mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn --batch-mode --update-snapshots -Dmaven.test.skip=true verify | |
env: | |
DM_CONNECTION_STRING: https://ingest-sdkse2etest.eastus.kusto.windows.net | |
ENGINE_CONNECTION_STRING: https://sdkse2etest.eastus.kusto.windows.net | |
TEST_DATABASE: e2e | |
APP_ID: ${{ secrets.APP_ID }} | |
TENANT_ID: ${{ secrets.TENANT_ID }} | |
CI_EXECUTION: 1 | |
- name: Get version | |
id: get_version | |
run: echo ::set-output name=VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
- name: Move artifacts to staging | |
run: | | |
version=${{ steps.get_version.outputs.VERSION }} | |
mkdir staging | |
cp data/target/*.jar staging | |
cp ingest/target/*.jar staging | |
cp quickstart/target/*.jar staging | |
cp data/.flattened-pom.xml staging/kusto-data-$version.pom | |
cp ingest/.flattened-pom.xml staging/kusto-ingest-$version.pom | |
- name: Github Release | |
uses: docker://antonyurchenko/git-release:v6 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
args: | | |
staging/kusto-data-${{ steps.get_version.outputs.VERSION }}.jar | |
staging/kusto-data-${{ steps.get_version.outputs.VERSION }}-jar-with-dependencies.jar | |
staging/kusto-data-${{ steps.get_version.outputs.VERSION }}-javadoc.jar | |
staging/kusto-data-${{ steps.get_version.outputs.VERSION }}-sources.jar | |
staging/kusto-data-${{ steps.get_version.outputs.VERSION }}.pom | |
staging/kusto-ingest-${{ steps.get_version.outputs.VERSION }}.jar | |
staging/kusto-ingest-${{ steps.get_version.outputs.VERSION }}-jar-with-dependencies.jar | |
staging/kusto-ingest-${{ steps.get_version.outputs.VERSION }}-javadoc.jar | |
staging/kusto-ingest-${{ steps.get_version.outputs.VERSION }}-sources.jar | |
staging/kusto-ingest-${{ steps.get_version.outputs.VERSION }}.pom | |
continue-on-error: true | |
if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.github_release == 'true') }} | |
- uses: LanceMcCarthy/Action-AzureBlobUpload@v3 | |
name: Uploading to Azure storage | |
with: | |
connection_string: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING}} | |
container_name: ${{ secrets.AZURE_STORAGE_CONTAINER}} | |
source_folder: staging | |
destination_folder: kusto/java/${{ steps.get_version.outputs.VERSION }} | |
delete_if_exists: true | |
if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_azure == 'true') }} | |
- name: Trigger pipelines release | |
uses: jacopocarlini/azure-pipelines@v1.3 | |
with: | |
azure-devops-project-url: '${{ secrets.AZURE_PIPELINES_RELEASE_REPO }}' | |
azure-devops-token: '${{ secrets.AZURE_PIPELINES_PAT }}' | |
azure-pipeline-name: 'java - partner-release' | |
azure-template-parameters: '{"BlobPath": "kusto/java/${{ steps.get_version.outputs.VERSION }}"}' | |
if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_maven == 'true') }} | |