Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .bcr/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module(
name = "khttpd",
version = "{{VERSION}}",
)
12 changes: 12 additions & 0 deletions .bcr/metadata.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"homepage": "https://github.com/ClangTools/khttpd",
"maintainers": [
{
"email": "kekxv@github.com",
"github": "ClangTools"
}
],
"repository": ["github:ClangTools/khttpd"],
"versions": [],
"yanked_versions": {}
}
16 changes: 16 additions & 0 deletions .bcr/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
matrix:
platform:
- ubuntu2404
- macos
- windows
bazel:
- 7.x
- 8.x

tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@khttpd//...'
4 changes: 4 additions & 0 deletions .bcr/source.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"url": "https://github.com/ClangTools/khttpd/releases/download/{{TAG}}/khttpd-{{VERSION}}.tar.gz",
"strip_prefix": "khttpd-{{VERSION}}"
}
49 changes: 49 additions & 0 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,52 @@ jobs:
cd example
bazel build app
cd ..

release:
needs: [build, example]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Extract version from MODULE.bazel
id: version
run: |
VERSION=$(grep -oP 'version\s*=\s*"\K[^"]+' MODULE.bazel | head -1)
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "Found version: ${VERSION}"

- name: Check if tag exists
id: check_tag
run: |
TAG="v${{ steps.version.outputs.version }}"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "Tag ${TAG} already exists, skipping release."
else
echo "exists=false" >> "$GITHUB_OUTPUT"
echo "Tag ${TAG} does not exist, will create release."
fi

- name: Create tag
if: steps.check_tag.outputs.exists == 'false'
run: |
TAG="v${{ steps.version.outputs.version }}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "$TAG"
git push origin "$TAG"

- name: Create GitHub Release
if: steps.check_tag.outputs.exists == 'false'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
name: Release v${{ steps.version.outputs.version }}
generate_release_notes: true
draft: false
14 changes: 14 additions & 0 deletions .github/workflows/publish_to_bcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Publish to BCR

on:
release:
types: [published]

jobs:
publish:
uses: kekxv/bcr/.github/workflows/publish_to_bcr.yml@publish-to-bcr
with:
tag_name: ${{ github.event.release.tag_name }}
module_name: "khttpd"
secrets:
publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }}
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ single_version_override(
)

bazel_dep(name = "fmt", version = "12.0.0")
bazel_dep(name = "googletest", version = "1.17.0.bcr.1")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
bazel_dep(name = "sqlite3", version = "3.50.4")
bazel_dep(name = "openssl", version = "3.3.1.bcr.9")
bazel_dep(name = "boringssl", version = "0.20251110.0")
Expand Down
337 changes: 278 additions & 59 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

Loading
Loading