File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : " Set up Hatch build tooling"
2+ description : >-
3+ Install the pinned hatch / hatchling / virtualenv toolchain used to build
4+ and publish the package. Assumes Python is already set up by the caller.
5+
6+ runs :
7+ using : " composite"
8+ steps :
9+ - shell : bash
10+ run : |
11+ python -m pip install --upgrade pip
12+ pip install "virtualenv<20.36"
13+ pip install hatchling==1.27.0 hatch==1.14.0
Original file line number Diff line number Diff line change 4545 with :
4646 push : true
4747 platforms : linux/amd64,linux/arm64
48+ cache-from : type=gha
49+ cache-to : type=gha,mode=max
4850 tags : socketdev/cli:stable
4951 build-args : |
5052 CLI_VERSION=${{ inputs.version }}
Original file line number Diff line number Diff line change 33 pull_request :
44 types : [opened, synchronize, ready_for_review]
55
6+ # Cancel an in-flight preview when the PR is pushed again -- previews are slow
7+ # (publish + multi-step Docker build), so superseded runs shouldn't keep going.
8+ concurrency :
9+ group : pr-preview-${{ github.event.pull_request.number }}
10+ cancel-in-progress : true
11+
612jobs :
713 preview :
814 # Skip on:
2632 with :
2733 python-version : ' 3.13'
2834
29- # Install all dependencies from pyproject.toml
30- - name : Install dependencies
31- run : |
32- python -m pip install --upgrade pip
33- pip install "virtualenv<20.36"
34- pip install hatchling==1.27.0 hatch==1.14.0
35+ - name : Install build tooling
36+ uses : ./.github/actions/setup-hatch
3537
3638 - name : Inject full dynamic version
3739 run : python .hooks/sync_version.py --dev
@@ -159,7 +161,12 @@ jobs:
159161 VERSION : ${{ env.VERSION }}
160162 with :
161163 push : true
162- platforms : linux/amd64,linux/arm64
164+ # Preview images are for quick testing -- build amd64 only. arm64 via
165+ # QEMU emulation is the slowest part of the job; release builds keep
166+ # multi-arch. GHA layer cache speeds up repeated preview builds.
167+ platforms : linux/amd64
168+ cache-from : type=gha
169+ cache-to : type=gha,mode=max
163170 tags : |
164171 socketdev/cli:pr-${{ github.event.pull_request.number }}
165172 build-args : |
Original file line number Diff line number Diff line change 1818 with :
1919 python-version : ' 3.13'
2020
21- # Install all dependencies from pyproject.toml
22- - name : Install dependencies
23- run : |
24- python -m pip install --upgrade pip
25- pip install "virtualenv<20.36"
26- pip install hatchling==1.27.0 hatch==1.14.0
27-
21+ - name : Install build tooling
22+ uses : ./.github/actions/setup-hatch
23+
2824 - name : Get Version
2925 id : version
3026 env :
@@ -112,6 +108,8 @@ jobs:
112108 with :
113109 push : true
114110 platforms : linux/amd64,linux/arm64
111+ cache-from : type=gha
112+ cache-to : type=gha,mode=max
115113 tags : |
116114 socketdev/cli:latest
117115 socketdev/cli:${{ env.VERSION }}
You can’t perform that action at this time.
0 commit comments