Skip to content

Commit

Permalink
Build and package C# and PowerShell SDKs when creating a release
Browse files Browse the repository at this point in the history
Signed-off-by: Danilo Del Busso <[email protected]>

damnit
  • Loading branch information
danilo-delbusso committed Mar 6, 2024
1 parent 72e9614 commit 89e4f79
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 7 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ jobs:
name: Run OCaml tests
runs-on: ubuntu-20.04
env:
# Ensure you also update test-sdk-builds
# when changing this value, to keep builds
# consistent
XAPI_VERSION: "v0.0.0"
steps:
- name: Checkout code
Expand Down Expand Up @@ -172,4 +175,7 @@ jobs:
name: Test SDK builds
uses: ./.github/workflows/generate-and-build-sdks.yml
with:
xapi_version: ${{ env.XAPI_VERSION }}
# Ensure you also update ocaml-tests
# when changing this value, to keep builds
# consistent
xapi_version: "v0.0.0"
50 changes: 44 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand All @@ -34,23 +35,60 @@ jobs:
name: XenAPI
path: scripts/examples/python/dist/

build-sdks:
name: Build and upload SDK artifacts
uses: ./.github/workflows/generate-and-build-sdks.yml
with:
xapi_version: ${{ github.ref_name }}

release:
name: "Create and package release"
runs-on: ubuntu-latest
needs: build-python
needs: [build-python, build-sdks]
steps:
- name: Retrieve python distribution artifacts
- 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: SDK_Binaries_CSharp
path: dist/

- name: Retrieve PowerShell 5.x SDK distribution artifacts
uses: actions/download-artifact@v3
with:
name: XenServerPowerShell_NET45
path: sdk_powershell_5x/

- name: Retrieve PowerShell 7.x SDK distribution artifacts
uses: actions/download-artifact@v3
with:
name: XenServerPowerShell_NET8
path: sdk_powershell_7x/

- 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

- name: Create release ${{ github.ref_name }}
run: gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --generate-notes dist/*
shell: bash
run: |
gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --generate-notes dist/*
gh release upload ${{ github.ref_name }} --repo ${{ github.repository }} PowerShell-SDK-5.x-prerelease-unsigned.zip
gh release upload ${{ github.ref_name }} --repo ${{ github.repository }} PowerShell-SDK-7.x-prerelease-unsigned.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-pypi:
name: Publish Python release to PyPI
runs-on: ubuntu-latest
needs: release
environment: pypi
Expand All @@ -63,5 +101,5 @@ jobs:
name: XenAPI
path: dist/

- name: Publish the Python release to PyPI
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 89e4f79

Please sign in to comment.