Skip to content

Commit

Permalink
[MDAPI-135] [C++] Add the ability to create a bundle to build with al…
Browse files Browse the repository at this point in the history
…l dependencies.
  • Loading branch information
ttldtor committed Oct 2, 2024
1 parent 650aaca commit 99f5449
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 1 deletion.
36 changes: 35 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,44 @@ jobs:
build-Samples/*.zip
build-Tools/*.zip
build_full_src_bundle_and_upload:
name: "${{ matrix.config.name }}: Build Full Source Bundle & Upload"
needs: [ get_version ]
strategy:
matrix:
config:
- name: win-vs2022
image: windows-latest
os: windows
cores: 4
cc: 'cl'
cxx: 'cl'
runs-on: ${{ matrix.config.image }}
steps:
- uses: actions/checkout@v4

- name: Prepare build [Full Source Bundle]
run: |
ls
mkdir ${{github.workspace}}/build-bundle
- name: Build [Full Source Bundle]
shell: pwsh
run: |
${{github.workspace}}/scripts/make-source-bundle.ps1 ${{needs.get_version.outputs.version}}
- name: Upload [Full Source Bundle]
uses: actions/upload-artifact@v4
with:
name: artifacts-full-source-bundle-${{matrix.config.name}}
path: |
build-bundle/*.zip
publish_release:
if: ${{ inputs.publish || contains(github.event_name, 'push')}}
runs-on: ubuntu-latest
name: Publish Release
needs: [ get_version, build_package_and_upload ]
needs: [ get_version, build_package_and_upload, build_full_src_bundle_and_upload ]
permissions:
contents: write
steps:
Expand All @@ -316,6 +349,7 @@ jobs:
artifacts/*.zip
artifacts/build-Samples/*.zip
artifacts/build-Tools/*.zip
artifacts/build-bundle/*.zip
prerelease: >
${{ contains(needs.get_version.outputs.version, 'alpha')
|| contains(needs.get_version.outputs.version, 'beta')
Expand Down
10 changes: 10 additions & 0 deletions deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Console": "1.0.1",
"date": "3.0.1",
"doctest": "2.4.11",
"fmt": "11.0.2",
"graal-native-sdk": "1.1.23",
"Process": "3.0.1",
"range-v3": "0.12",
"untfcpp": "3.2.3"
}
49 changes: 49 additions & 0 deletions scripts/make-source-bundle.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<#
.SYNOPSIS
This script prepares a full source bundle.
.PARAMETER DxFeedGraalCxxApiVersion
The dxFeed Graal CXX API version (https://github.com/dxFeed/dxfeed-graal-cxx-api).
#>
param (
[Parameter(Mandatory = $true)]
[string] $DxFeedGraalCxxApiVersion
)

if (!$DxFeedGraalCxxApiVersion)
{
Write-Error "\`$DxFeedGraalCxxApiVersion is not set"
}
else
{
$thisDir = Split-Path $MyInvocation.MyCommand.Path -Parent
$buildBundleDir = "$thisDir/../build-bundle"
$graalNativeSdkVer = $( Get-Content .\deps.json -Raw | ConvertFrom-Json )."graal-native-sdk"
Write-Host $graalNativeSdkVer

$bundleName = "dxFeedGraalCxxApi-$DxFeedGraalCxxApiVersion-x86_64-windows-full-src"
$downloadPath = "$buildBundleDir/download"
$bundlePath = "$buildBundleDir/$bundleName"

New-Item -ItemType Directory -Force -Path $downloadPath
New-Item -ItemType Directory -Force -Path $bundlePath

Copy-Item -Path "$thisDir/../.github" -Recurse -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../cmake" -Recurse -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../docs" -Recurse -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../include" -Recurse -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../resources" -Recurse -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../samples" -Recurse -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../scripts" -Recurse -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../src" -Recurse -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../tests" -Recurse -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../third_party" -Recurse -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../tools" -Recurse -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../*.md" -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../*.json" -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../*.txt" -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../LICENSE" -Force -Destination "$bundlePath"
Copy-Item -Path "$thisDir/../.clang-format" -Force -Destination "$bundlePath"
Invoke-WebRequest -Uri "https://dxfeed.jfrog.io/artifactory/maven-open/com/dxfeed/graal-native-sdk/${graalNativeSdkVer}/graal-native-sdk-${graalNativeSdkVer}-amd64-windows.zip" -OutFile "$downloadPath/graal-native-sdk-${graalNativeSdkVer}-amd64-windows.zip"
Expand-Archive -Path "$downloadPath/graal-native-sdk-${graalNativeSdkVer}-amd64-windows.zip" -Force -DestinationPath "$bundlePath/third_party/graal-native-sdk-${graalNativeSdkVer}-amd64-windows"
Compress-Archive -Path "$bundlePath" -DestinationPath "$buildBundleDir/$bundleName.zip"
}

0 comments on commit 99f5449

Please sign in to comment.