-
Notifications
You must be signed in to change notification settings - Fork 284
138 lines (116 loc) · 4.14 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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@v5
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: python3/examples/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 Go SDK distribution artifacts
uses: actions/download-artifact@v4
with:
name: SDK_Artifacts_Go
path: sdk_go/
- name: Retrieve Python SDK distribution artifacts
uses: actions/download-artifact@v4
with:
name: XenAPI
path: dist/
- name: Retrieve C SDK distribution binaries
uses: actions/download-artifact@v4
with:
name: SDK_Artifacts_C
path: libxenserver/usr/local/
- name: Retrieve Java SDK distribution artifacts
uses: actions/download-artifact@v4
with:
name: SDK_Artifacts_Java
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: Package C SDK artifacts for deployment
shell: bash
run: |
mkdir -p libxenserver/usr/local/lib
mv libxenserver/usr/local/libxenserver.* libxenserver/usr/local/lib/
tar -zcvf libxenserver-prerelease.tar.gz -C ./libxenserver usr/local/lib/ usr/local/include/xen/api
rm -rf libxenserver/usr/local/lib/
tar -zcvf libxenserver-prerelease.src.tar.gz -C ./libxenserver/usr/local .
- 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: Zip Go SDK artifacts for deployment
shell: bash
run: zip Go-SDK-prerelease-unsigned.zip ./sdk_go -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 \
Go-SDK-prerelease-unsigned.zip \
libxenserver-prerelease.tar.gz libxenserver-prerelease.src.tar.gz
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