-
Notifications
You must be signed in to change notification settings - Fork 6
73 lines (61 loc) · 1.89 KB
/
build.yaml
File metadata and controls
73 lines (61 loc) · 1.89 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
name: Build & Package
# This workflow builds and packages the SDK
# Requires approval for fork PRs (uses same approval as tests)
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
PYTHON_VERSION: "3.11"
SDK_DIST_NAME: "sap_cloud_sdk"
jobs:
build:
name: Build SDK
runs-on: ${{ contains(github.server_url, 'github.com') && 'ubuntu-latest' || fromJSON('["self-hosted"]') }}
permissions:
contents: read
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
- name: "Install uv"
uses: astral-sh/setup-uv@v3
with:
version: "latest"
enable-cache: true
- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: "Build Packages"
run: uv build
- name: "List Build Artifacts"
run: |
echo "Build artifacts:"
ls -lh dist/
- name: "Verify Build Artifacts"
run: |
# Check that both wheel and source distribution were created
wheel_count=$(ls -1 dist/*.whl 2>/dev/null | wc -l)
tar_count=$(ls -1 dist/*.tar.gz 2>/dev/null | wc -l)
if [ "$wheel_count" -eq 0 ]; then
echo "ERROR: No wheel file found"
exit 1
fi
if [ "$tar_count" -eq 0 ]; then
echo "ERROR: No source distribution found"
exit 1
fi
echo "✓ Build artifacts verified: $wheel_count wheel(s), $tar_count source distribution(s)"
- name: "Upload Build Artifacts"
uses: actions/upload-artifact@v4
if: contains(github.server_url, 'github.com')
with:
name: ${{ env.SDK_DIST_NAME }}
path: dist/
retention-days: 7