-
Notifications
You must be signed in to change notification settings - Fork 284
77 lines (63 loc) · 1.84 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
name: Create release from tag
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
env:
XAPI_VERSION: ${{ github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- 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@v3
with:
name: XenAPI
path: scripts/examples/python/dist/
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Retrieve python distribution artifacts
uses: actions/download-artifact@v3
with:
name: XenAPI
path: dist/
- name: Draft Release ${{ github.ref_name }}
run: gh release create ${{ github.ref_name }} --draft --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts
run: gh release upload ${{ github.ref_name }} dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
runs-on: ubuntu-latest
needs: release
environment: pypi
permissions:
id-token: write
steps:
- name: Retrieve python distribution artifacts
uses: actions/download-artifact@v3
with:
name: XenAPI
path: dist/
- name: Publish the Python release to PyPI
uses: pypa/gh-action-pypi-publish@release/v1