Skip to content

Commit

Permalink
Added github workflow to build and release the C SDK.
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
  • Loading branch information
kc284 committed Apr 18, 2024
1 parent e6afe15 commit 6681b7d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/generate-and-build-sdks.yml
Expand Up @@ -24,6 +24,12 @@ jobs:
shell: bash
run: opam exec -- make sdk

- name: Store C SDK source
uses: actions/upload-artifact@v4
with:
name: SDK_Source_C
path: _build/install/default/xapi/sdk/c/*

- name: Store C# SDK source
uses: actions/upload-artifact@v4
with:
Expand All @@ -39,6 +45,30 @@ jobs:
- name: Cleanup XenAPI environment
uses: ./.github/workflows/cleanup-xapi-environment

build-c-sdk:
name: Build C SDK
runs-on: ubuntu-latest
needs: generate-sdk-sources
steps:
- name: Install dependencies
run: sudo apt-get install libxml2-dev

- name: Retrieve C SDK source
uses: actions/download-artifact@v4
with:
name: SDK_Source_C
path: source/

- name: Build C SDK
shell: bash
run: make -C source

- name: Store C SDK
uses: actions/upload-artifact@v4
with:
name: SDK_Artifacts_C
path: source/*

build-csharp-sdk:
name: Build C# SDK
runs-on: windows-2022
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/release.yml
Expand Up @@ -52,6 +52,12 @@ jobs:
name: XenAPI
path: dist/

- name: Retrieve C SDK distribution binaries
uses: actions/download-artifact@v4
with:
name: SDK_Artifacts_C
path: libxenserver/usr/local/

- name: Retrieve C# SDK distribution artifacts
uses: actions/download-artifact@v4
with:
Expand All @@ -70,10 +76,19 @@ jobs:
name: SDK_Binaries_XenServerPowerShell_NET6
path: sdk_powershell_7x/

- name: Package C SDK artifacts for deployment
shell: bash
run: |
mkdir -p libxenserver/usr/local/lib
mv libxenserver/usr/local/libxenserver.* libxenserver/usr/local/lib/
tar -zcvf libxenserver-prerelease.tar.gz -C ./libxenserver usr/local/lib/ usr/local/include/xen/api
rm -rf libxenserver/usr/local/lib/
tar -zcvf libxenserver-prerelease.src.tar.gz -C ./libxenserver/usr/local .
- name: Zip PowerShell 5.x SDK artifacts for deployment
shell: bash
run: zip PowerShell-SDK-5.x-prerelease-unsigned.zip ./sdk_powershell_5x -r

- name: Zip PowerShell 7.x SDK artifacts for deployment
shell: bash
run: zip PowerShell-SDK-7.x-prerelease-unsigned.zip ./sdk_powershell_7x -r
Expand All @@ -83,7 +98,8 @@ jobs:
run: |
gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --generate-notes dist/* \
PowerShell-SDK-5.x-prerelease-unsigned.zip \
PowerShell-SDK-7.x-prerelease-unsigned.zip
PowerShell-SDK-7.x-prerelease-unsigned.zip \
libxenserver-prerelease.tar.gz libxenserver-prerelease.src.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down

0 comments on commit 6681b7d

Please sign in to comment.