-
Notifications
You must be signed in to change notification settings - Fork 43
119 lines (116 loc) · 4.96 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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') }}
- name: Azure login for azuresdkpartnerdrops SA
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURESDKPARTNERDROPS_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id:
${{ secrets.AZURESDKPARTNERDROPS_SUBSCRIPTION_ID }}
- name: Upload file to Blob Storage
run: |
az storage blob upload-batch \
--account-name ${{ secrets.AZURE_RELEASE_STORAGE_ACCOUNT }} \
--destination ${{ secrets.AZURE_STORAGE_CONTAINER }}/kusto/java/${{ steps.get_version.outputs.VERSION }} \
--source staging \
--auth-mode login
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') }}