-
Notifications
You must be signed in to change notification settings - Fork 1
205 lines (175 loc) · 6.83 KB
/
cli.yml
File metadata and controls
205 lines (175 loc) · 6.83 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Build and release CLI
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+.post[0-9]+"
# Ignore pre-release tags
# https://packaging.python.org/en/latest/specifications/version-specifiers/#public-version-identifiers
- "!v[0-9]+.[0-9]+.[0-9]+a*"
- "!v[0-9]+.[0-9]+.[0-9]+b*"
- "!v[0-9]+.[0-9]+.[0-9]+rc*"
jobs:
determine-pex-platforms:
strategy:
matrix:
include:
- os: macos
image: macos-latest
arch: aarch64
- os: macos
image: macos-15-intel
arch: x86_64
- os: linux
image: ubuntu-24.04
arch: x86_64
- os: linux
image: ubuntu-24.04-arm64
arch: aarch64
name: Determine pex platforms (${{ matrix.os }}/${{ matrix.arch }})
runs-on: ${{ matrix.image }}
steps:
- uses: actions/checkout@v6
with:
sparse-checkout: |
.python-version
sparse-checkout-cone-mode: false
- uses: actions/setup-python@v6
- name: Determine complete_platforms for pex
run: |
python -m venv .venv
.venv/bin/python -m pip install pex
.venv/bin/pex3 interpreter inspect --markers --tags > ${{ matrix.os }}_py313_${{ matrix.arch }}.json
- uses: actions/upload-artifact@v4
with:
name: "${{ matrix.os }}_py313_${{ matrix.arch }}"
path: "${{ matrix.os }}_py313_${{ matrix.arch }}.json"
overwrite: true
build-bin-artifacts:
name: Build MacOS + Linux binaries
needs: [determine-pex-platforms]
# Ideally `determine-pex-platforms`, `build-bin-artifacts`, and `exercise-artifacts` jobs would be combined.
# But the `scie_binary` target does not appear to work on macOS.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v4
with:
pattern: "*_py313_*"
path: build-support/pex_platforms
merge-multiple: true
- uses: actions/setup-python@v6
# This action bootstraps pants and manages 2-3 GHA caches.
# See: github.com/pantsbuild/actions/tree/main/init-pants/
- uses: pantsbuild/actions/init-pants@v9
- name: Create binaries
run: |
pants package :roboto
pants package :roboto-agent
- name: Package Arm64 .deb
run: |
VERSION="$(./dist/roboto-linux-x86_64 --version --suppress-upgrade-check)"
mkdir -p roboto_arm_deb/DEBIAN
echo "Package: roboto" > roboto_arm_deb/DEBIAN/control
echo "Version: ${VERSION}" >> roboto_arm_deb/DEBIAN/control
echo "Architecture: arm64" >> roboto_arm_deb/DEBIAN/control
echo "Maintainer: Roboto AI <support@roboto.ai>" >> roboto_arm_deb/DEBIAN/control
echo "Description: Roboto CLI and Agent" >> roboto_arm_deb/DEBIAN/control
mkdir -p roboto_arm_deb/usr/bin
cp ./dist/roboto-linux-aarch64 roboto_arm_deb/usr/bin/roboto
cp ./dist/roboto-agent-linux-aarch64 roboto_arm_deb/usr/bin/roboto-agent
dpkg-deb --build roboto_arm_deb dist/roboto-linux-aarch64_${VERSION}.deb
- name: Package x86_64 .deb
run: |
VERSION="$(./dist/roboto-linux-x86_64 --version --suppress-upgrade-check)"
mkdir -p roboto_x86_64_deb/DEBIAN
echo "Package: roboto" > roboto_x86_64_deb/DEBIAN/control
echo "Version: ${VERSION}" >> roboto_x86_64_deb/DEBIAN/control
echo "Architecture: amd64" >> roboto_x86_64_deb/DEBIAN/control
echo "Maintainer: Roboto AI <support@roboto.ai>" >> roboto_x86_64_deb/DEBIAN/control
echo "Description: Roboto CLI and Agent" >> roboto_x86_64_deb/DEBIAN/control
mkdir -p roboto_x86_64_deb/usr/bin
cp ./dist/roboto-linux-x86_64 roboto_x86_64_deb/usr/bin/roboto
cp ./dist/roboto-agent-linux-x86_64 roboto_x86_64_deb/usr/bin/roboto-agent
dpkg-deb --build roboto_x86_64_deb dist/roboto-linux-x86_64_${VERSION}.deb
- uses: actions/upload-artifact@v4
with:
name: bin-artifacts
path: dist/
overwrite: true
exercise-artifacts:
needs: [build-bin-artifacts]
strategy:
matrix:
include:
- image: macos-latest
os: macos
arch: aarch64
- image: macos-15-intel
os: macos
arch: x86_64
- image: ubuntu-24.04
os: linux
arch: x86_64
- image: ubuntu-24.04-arm64
os: linux
arch: aarch64
name: Exercise (${{ matrix.os }}/${{ matrix.arch }}) Binaries
runs-on: ${{ matrix.image }}
steps:
- uses: actions/download-artifact@v4
with:
name: bin-artifacts
path: dist
- name: Exercise roboto CLI
run: |
chmod +x ./dist/roboto-${{ matrix.os }}-${{ matrix.arch }}
./dist/roboto-${{ matrix.os }}-${{ matrix.arch }} --version --suppress-upgrade-check
- name: Exercise roboto-agent
run: |
chmod +x ./dist/roboto-agent-${{ matrix.os }}-${{ matrix.arch }}
./dist/roboto-agent-${{ matrix.os }}-${{ matrix.arch }} --help
build-and-exercise-windows:
name: Build (windows/x86_64) binaries
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- name: Install deps
run: |
pip install .
pip install pyinstaller
- name: Create binaries
run: |
python -m PyInstaller --name roboto-windows-x86_64 --target-architecture x86_64 --onefile --paths src --collect-data cookiecutter --collect-all binaryornot cli_entrypoint.py
python -m PyInstaller --name roboto-agent-windows-x86_64 --target-architecture x86_64 --onefile --paths src agent_entrypoint.py
- name: Exercise roboto CLI
run: ./dist/roboto-windows-x86_64 --version --suppress-upgrade-check
- name: Exercise roboto-agent
run: ./dist/roboto-agent-windows-x86_64 --help
- uses: actions/upload-artifact@v4
with:
name: windows-artifacts
path: dist/
overwrite: true
release:
needs: [exercise-artifacts, build-bin-artifacts, build-and-exercise-windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
sparse-checkout: |
RELEASE_NOTES.md
sparse-checkout-cone-mode: false
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- name: List artifacts
run: ls -R dist
- name: Release
uses: softprops/action-gh-release@v2
with:
files: dist/roboto-*
body_path: RELEASE_NOTES.md
make_latest: true