From 6de5b1198db2ff9f4b34b2e6d9d61d4eff246534 Mon Sep 17 00:00:00 2001 From: Danilo Del Busso Date: Tue, 6 Feb 2024 09:23:38 +0000 Subject: [PATCH] Package C# SDK `.nupkg` in release artifacts Signed-off-by: Danilo Del Busso --- .github/workflows/release.yml | 52 +++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f55374239b..bc90acb61e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,10 +3,11 @@ name: Create release from tag on: push: tags: - - 'v*' + - "v*" jobs: build-python: + name: Build and upload Python artifacts runs-on: ubuntu-latest steps: @@ -16,7 +17,7 @@ jobs: - name: Use python uses: actions/setup-python@v4 with: - python-version: '3.x' + python-version: "3.x" - name: Install build dependencies run: | @@ -34,10 +35,43 @@ jobs: name: XenAPI path: scripts/examples/python/dist/ + build-sdks: + name: Build and upload SDK artifacts + runs-on: ubuntu-latest + env: + XAPI_VERSION: ${{ github.ref_name }} + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup XenAPI environment + uses: ./.github/workflows/setup-xapi-environment + with: + xapi_version: ${{ env.XAPI_VERSION }} + + - name: Generate and build SDKs + uses: ./.github/workflows/generate-and-build-sdks + with: + xapi_version: ${{ env.XAPI_VERSION }} + + - name: Store C# SDK distribution artifacts + uses: actions/upload-artifact@v3 + with: + name: XenServer.NET + path: _build/install/default/xapi/sdk/csharp/src/bin/Release/*-prerelease-unsigned.nupkg + + - name: Uninstall unversioned packages and remove pins + # This should purge them from the cache, unversioned package have + # 'master' as its version + run: | + opam list | awk -F " " '$2 == "master" { print $1 }' | xargs opam uninstall + opam pin list | cut -f1 -d "." | xargs opam unpin release: + name: "Create and package release" runs-on: ubuntu-latest - needs: build-python + needs: [build-python, build-sdks] steps: - name: Retrieve python distribution artifacts uses: actions/download-artifact@v3 @@ -45,6 +79,18 @@ jobs: name: XenAPI path: dist/ + - name: Retrieve Python SDK distribution artifacts + uses: actions/download-artifact@v3 + with: + name: XenAPI + path: dist/ + + - name: Retrieve C# SDK distribution artifacts + uses: actions/download-artifact@v3 + with: + name: XenServer.NET + path: dist/ + - name: Create release ${{ github.ref_name }} run: gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --generate-notes dist/* env: