forked from amazon-archives/sql-odbc
-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (145 loc) · 4.6 KB
/
release-workflow.yml
File metadata and controls
147 lines (145 loc) · 4.6 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Build and Release SQL-ODBC
# This workflow is triggered on creating tags to master or an opendistro release branch
on:
push:
tags:
- 'v*'
jobs:
build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: run-cppcheck
run: |
brew install cppcheck
sh run_cppcheck.sh
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: upload-cppcheck-results
if: failure()
uses: actions/upload-artifact@v1
with:
name: cppcheck-results
path: cppcheck-results.log
- name: get-dependencies
run: |
brew unlink unixodbc
brew install curl
brew install cmake
brew install libiodbc
- name: aws-sdk-cpp-setup
run: |
sh aws_sdk_cpp_setup.sh
- name: configure
run: |
prefix_path=$(pwd)
mkdir cmake-build
cd cmake-build
cmake ../src -DCMAKE_INSTALL_PREFIX=$prefix_path/AWSSDK/ -DCMAKE_BUILD_TYPE=Release -DBUILD_ONLY="core" -DCUSTOM_MEMORY_MANAGEMENT="OFF" -DENABLE_RTTI="OFF" -DENABLE_TESTING="OFF"
cd ..
- name: build-driver
run: |
cmake --build cmake-build
- name: build-installer
if: success()
run: |
cd cmake-build
cmake ../src
make
cpack .
cd ..
- name: create-output
if: success()
run: |
mkdir build
mkdir test-output
mkdir installer
cp ./lib64/*.dylib build
cp ./lib64/*.a build
cp $(ls -d bin64/* | grep -v "\.") build
cp ./cmake-build/*.pkg installer
- name: upload-build
if: success()
uses: actions/upload-artifact@v1
with:
name: mac-build
path: build
- name: upload-installer
if: success()
uses: actions/upload-artifact@v1
with:
name: mac-installer
path: installer
- name: upload-artifacts-s3
if: success()
run: |
cd installer
mac_installer=`ls -1t *.pkg | grep "ODFE SQL ODBC Driver" | head -1`
echo $mac_installer
aws s3 cp "$mac_installer" s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/elasticsearch-clients/opendistro-sql-odbc/mac/
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: add-msbuild-to-path
uses: microsoft/setup-msbuild@v1.0.0
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: aws-sdk-cpp-setup
run: |
.\aws_sdk_cpp_setup.ps1
- name: configure
run: |
$prefix_path = (pwd).path
mkdir cmake-build
cd cmake-build
cmake ..\\src -D CMAKE_INSTALL_PREFIX=$prefix_path\AWSSDK\
cd ..
- name: build-driver
run: |
cmake --build cmake-build --config Release
- name: build-installer
if: success()
run: |
cd cmake-build
cmake ..\\src -D CMAKE_INSTALL_PREFIX=$prefix_path\AWSSDK\ -D BUILD_WITH_TESTS=OFF
msbuild .\PACKAGE.vcxproj -p:Configuration=Release
cd ..
- name: create-output
if: always()
run: |
mkdir build
mkdir test-output
mkdir installer
cp .\\bin64\\Release\\*.dll build
cp .\\bin64\\Release\\*.exe build
cp .\\lib64\\Release\\*.lib build
cp .\\cmake-build\\*.msi installer
- name: upload-build
if: always()
uses: actions/upload-artifact@v1
with:
name: windows-build
path: build
- name: upload-installer
if: always()
uses: actions/upload-artifact@v1
with:
name: windows-installer
path: installer
- name: upload-artifacts-s3
if: success()
shell: bash
run: |
cd installer
windows_installer=`ls -1t *.msi | grep "ODFE SQL ODBC Driver" | head -1`
echo $windows_installer
aws s3 cp "$windows_installer" s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/elasticsearch-clients/opendistro-sql-odbc/windows/