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]>
  • Loading branch information
danilo-delbusso committed Feb 16, 2024
1 parent 5313ad5 commit 979dc98
Showing 1 changed file with 44 additions and 6 deletions.
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 979dc98

Please sign in to comment.