-
Notifications
You must be signed in to change notification settings - Fork 21
109 lines (94 loc) · 2.57 KB
/
build_and_upload.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
name: build and upload wheels
on:
push:
tags:
- "v*"
jobs:
build-wheels-linux:
name: build linux wheel
runs-on: ubuntu-latest
steps:
- name: checkout agent0
uses: actions/checkout@v4
with:
token: ${{github.token}}
- name: set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
token: ${{github.token}}
- name: set up pip
run: python -m pip install --upgrade pip
- name: build agent0
shell: bash
run: source scripts/build_wheels.sh
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-linux
path: dist/*.whl
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build-wheels-linux, build-sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
contents: write
steps:
- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Upload to pypi
uses: pypa/gh-action-pypi-publish@release/v1
generate-dependencies:
needs: [upload_pypi]
name: generate dependency file
runs-on: ubuntu-latest
steps:
- name: checkout agent0
uses: actions/checkout@v4
with:
token: ${{github.token}}
- name: set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
token: ${{github.token}}
- name: generate dependency file
shell: bash
run: source scripts/generate_deps.sh
- name: upload dependency file
uses: actions/upload-artifact@v4
with:
name: frozen-dependencies
path: ./frozen-requirements.txt
upload-dependencies:
needs: [generate-dependencies]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download dependency list artifact
uses: actions/download-artifact@v4
with:
pattern: frozen-requirements.txt
- name: Upload dependency list to release
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
gh release upload ${{ github.ref_name }} ./frozen-requirements.txt