Skip to content

Commit

Permalink
Add build just recipe and use it in CI (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
SRv6d authored Sep 15, 2024
1 parent 1558d93 commit 5745db9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ jobs:
- uses: astral-sh/setup-uv@v2
with:
enable-cache: true
- name: Build
run: uv build
- uses: extractions/setup-just@v2

- run: just build

- name: Attest Build Provenance
uses: actions/attest-build-provenance@v1
with:
subject-path: dist/anycastd-*

- name: Upload Build Artifacts
run: >-
gh release upload "${GITHUB_REF_NAME}"
Expand Down
20 changes: 19 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,23 @@ test $COV=env("CI", "false") $FRR_VERSION=FRR_LATEST_MAJOR_VERSION:
uv run pytest tests ${args[@]}

if [ $COV = "true" ]; then
uv run coverage xml
uv run coverage xml
fi

# Build sdist and wheel
build:
#!/usr/bin/env bash
set -euxo pipefail
# Validate version in pyproject.toml matches that of the git tag if running in CI
if [ ! -z ${CI+x} ]; then
PROJECT_VERSION="$(grep -Po '(?<=^version = ").*(?=")' pyproject.toml)"
GIT_TAG="$(git describe --exact-match --tags)"

if [ ! $PROJECT_VERSION == ${GIT_TAG:1} ]; then
echo Project version $PROJECT_VERSION does not match git tag $GIT_TAG
exit 1
fi
fi

uv build

0 comments on commit 5745db9

Please sign in to comment.