-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
51 additions
and
1,287 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,75 @@ | ||
name: Build installer | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- build/older-glibc-version | ||
|
||
env: | ||
BUILD_TYPE: Release | ||
DRIVER_VERSION: 1.1.0 | ||
|
||
jobs: | ||
build-windows: | ||
name: Windows | ||
runs-on: windows-latest | ||
build-linux: | ||
name: Linux | ||
runs-on: ubuntu-20.04 | ||
env: | ||
CMAKE_GENERATOR: Visual Studio 17 2022 | ||
WIX_DIR: "C:/Program Files (x86)/WiX Toolset v3.14/bin" | ||
CMAKE_GENERATOR: Unix Makefiles | ||
CXX: g++-11 | ||
CC: gcc-11 | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
|
||
# Configure build environment/dependencies | ||
- name: Install MySQL client libs | ||
- name: Install build dependencies | ||
run: | | ||
curl -L https://dev.mysql.com/get/Downloads/MySQL-8.3/mysql-${{ vars.MYSQL_VERSION }}-winx64.zip -o mysql.zip | ||
unzip -d C:/ mysql.zip | ||
- name: Install OpenSSL 3 | ||
run: | | ||
curl -L https://download.firedaemon.com/FireDaemon-OpenSSL/openssl-3.3.1.zip -o openssl3.zip | ||
unzip -d C:/ openssl3.zip | ||
cp -r C:/openssl-3/x64/bin/libssl-3-x64.dll C:/Windows/System32/ | ||
cp -r C:/openssl-3/x64/bin/libcrypto-3-x64.dll C:/Windows/System32/ | ||
- name: Add msbuild to PATH | ||
uses: microsoft/setup-msbuild@v2 | ||
sudo apt-get update | ||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | ||
sudo apt-get install gcc-11 g++-11 | ||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11 --slave /usr/bin/g++ g++ /usr/bin/g++-11 | ||
sudo apt-get install build-essential libgtk-3-dev unixodbc unixodbc-dev libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev | ||
- name: Cache AWS SDK libraries | ||
id: cache-dynamic-aws-sdk | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
aws_sdk | ||
key: ${{ runner.os }}-aws-sdk-dynamic-lib | ||
- name: Install MySQL client libs and include files | ||
run: | | ||
curl -L https://dev.mysql.com/get/Downloads/MySQL-8.3/mysql-${{ vars.MYSQL_VERSION }}-linux-glibc2.28-x86_64.tar.xz -o mysql.tar.gz | ||
tar xf mysql.tar.gz | ||
- name: Build and install AWS SDK C++ | ||
working-directory: ./scripts | ||
if: steps.cache-dynamic-aws-sdk.outputs.cache-hit != 'true' | ||
run: | | ||
.\build_aws_sdk_win.ps1 x64 ${{ env.BUILD_TYPE}} ON "${{env.CMAKE_GENERATOR}}" | ||
./build_aws_sdk_unix.sh $BUILD_TYPE | ||
- name: Setup nmake | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
- name: Create build environment | ||
shell: bash | ||
run: cmake -E make_directory ${{ github.workspace }}/build | ||
|
||
- name: Run build installer script | ||
shell: pwsh | ||
run: | | ||
.\build_installer.ps1 x64 ${{ env.BUILD_TYPE}} "${{env.CMAKE_GENERATOR}}" C:/mysql-${{ vars.MYSQL_VERSION }}-winx64 "${{env.WIX_DIR}}" | ||
- name: Configure CMake | ||
shell: bash | ||
run: cmake -S . -B build | ||
-G "$CMAKE_GENERATOR" | ||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE | ||
-DMYSQLCLIENT_STATIC_LINKING=true | ||
-DWITH_UNIXODBC=1 | ||
-DCONNECTOR_PLATFORM=linux | ||
-DMYSQL_DIR=./mysql-${{ vars.MYSQL_VERSION }}-linux-glibc2.28-x86_64/ | ||
-DBUNDLE_DEPENDENCIES=true | ||
|
||
# Build driver | ||
- name: Build driver | ||
working-directory: ${{ github.workspace }}/build | ||
shell: bash | ||
run: cmake --build . --config $BUILD_TYPE | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/[email protected] | ||
with: | ||
role-skip-session-tagging: true | ||
aws-access-key-id: ${{ secrets.AWS_BUILD_KEY }} | ||
aws-secret-access-key: ${{ secrets.AWS_BUILD_SECRET_KEY }} | ||
aws-region: us-west-2 | ||
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | ||
role-external-id: ${{ secrets.AWS_ROLE_EXTERNAL_ID }} | ||
role-duration-seconds: 3600 | ||
- name: Build installer | ||
working-directory: ${{ github.workspace }}/build | ||
if: success() | ||
run: cpack . | ||
|
||
- name: Run signer script | ||
shell: pwsh | ||
working-directory: ./scripts | ||
run: | | ||
choco upgrade jq -y | ||
. ".\sign_installer.ps1" | ||
Invoke-SignInstaller ${{ github.workspace }}\wix winx64a ${{ env.DRIVER_VERSION}} ${{ secrets.AWS_UNSIGNED_BUCKET }} ${{ secrets.AWS_SIGNED_BUCKET }} ${{ secrets.AWS_S3_KEY }}aws-mysql-odbc-${{ env.DRIVER_VERSION}}-winx64a.msi | ||
- name: Upload Windows installer as artifact | ||
- name: Upload Linux installer as artifact | ||
if: success() | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: installers | ||
path: ${{ github.workspace }}/wix/*.msi | ||
name: installers-linux | ||
path: ${{ github.workspace }}/build/aws-mysql-odbc-*.tar.gz | ||
if-no-files-found: error |
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
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
Oops, something went wrong.