Merge pull request #5544 from psafont/private/paus/chelydra #36
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create release from tag | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build-python: | |
name: Build and upload Python artifacts | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Use python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install build dependencies | |
run: | | |
pip install build | |
sudo apt-get install ocaml dune libfindlib-ocaml-dev libdune-ocaml-dev libcmdliner-ocaml-dev | |
- name: Generate python package for XenAPI | |
run: | | |
./configure --xapi_version=${{ github.ref_name }} | |
make python | |
- name: Store python distribution artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
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, build-sdks] | |
steps: | |
- name: Retrieve Python SDK distribution artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: XenAPI | |
path: dist/ | |
- name: Retrieve C# SDK distribution artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: SDK_Binaries_CSharp | |
path: dist/ | |
- name: Retrieve PowerShell 5.x SDK distribution artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: SDK_Binaries_XenServerPowerShell_NET45 | |
path: sdk_powershell_5x/ | |
- name: Retrieve PowerShell 7.x SDK distribution artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: SDK_Binaries_XenServerPowerShell_NET6 | |
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 }} | |
shell: bash | |
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 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-pypi: | |
name: Publish Python release to PyPI | |
runs-on: ubuntu-latest | |
needs: release | |
environment: pypi | |
permissions: | |
id-token: write | |
steps: | |
- name: Retrieve python distribution artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: XenAPI | |
path: dist/ | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |