diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9f1ee1d29f8..6400d6cc97d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f55374239b..48e7f81a839 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,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 @@ -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