-
Notifications
You must be signed in to change notification settings - Fork 284
105 lines (88 loc) · 2.95 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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