-
Notifications
You must be signed in to change notification settings - Fork 7
95 lines (81 loc) · 3.61 KB
/
build-installer.yml
File metadata and controls
95 lines (81 loc) · 3.61 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
name: Build installer
on:
workflow_dispatch:
env:
BUILD_TYPE: Release
DRIVER_VERSION: 1.1.0
permissions:
id-token: write
contents: read
jobs:
build-windows:
name: Windows
runs-on: windows-latest
env:
CMAKE_GENERATOR: Visual Studio 17 2022
WIX_DIR: "C:/Program Files (x86)/WiX Toolset v3.14/bin"
steps:
- name: Checkout source code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Configure build environment/dependencies
- name: Install MySQL client libs
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.5.5.zip -o openssl3.zip
echo "3739c845f86906eed4b8e1c321a240a756e2eb5140537cddc796a85e36dc71d9 openssl3.zip" | shasum -a 256 -c
mkdir C:/openssl-3
unzip -d C:/openssl-3 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@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0
- name: Cache AWS SDK libraries
id: cache-dynamic-aws-sdk
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
aws_sdk
key: ${{ runner.os }}-aws-sdk-dynamic-lib
- 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}}"
- name: Setup nmake
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
- 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}}" "C:/openssl-3/x64/include/"
- name: Configure AWS credentials OIDC
uses: aws-actions/configure-aws-credentials@ff717079ee2060e4bcee96c4779b553acc87447c # v4
with:
role-skip-session-tagging: true
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_DEPLOY_ROLE }}
role-session-name: mysql-win-signer
- name: Configure AWS credentials Signer
uses: aws-actions/configure-aws-credentials@ff717079ee2060e4bcee96c4779b553acc87447c # v4
with:
role-skip-session-tagging: true
role-chaining: true
aws-region: us-west-2
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-external-id: ${{ secrets.AWS_ROLE_EXTERNAL_ID }}
- 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
if: success()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: installers
path: ${{ github.workspace }}/wix/*.msi
if-no-files-found: error