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
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
examples/
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#################################
# Configuration for 'git archive'
# See https://git-scm.com/docs/git-archive#ATTRIBUTES

# Don't include examples in the distribution artifact, to reduce size.
examples export-ignore
2 changes: 1 addition & 1 deletion .github/workflows/buildifier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: buildifier
run: bazel run --enable_bzlmod //.github/workflows:buildifier.check
15 changes: 0 additions & 15 deletions .github/workflows/ci.bazelrc

This file was deleted.

33 changes: 21 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,30 @@ concurrency:
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
test:
uses: bazel-contrib/.github/.github/workflows/bazel.yaml@v7
with:
folders: |
[
".",
]
exclude: |
[
{"folder": ".", "bzlmodEnabled": false}
]
bazel_test_command: "bazel build //..."
runs-on: ubuntu-latest
strategy:
matrix:
bazel: ["7.x", "8.x", "9.x"]
folder:
- .
- examples
defaults:
run:
working-directory: ${{ matrix.folder }}
env:
USE_BAZEL_VERSION: ${{ matrix.bazel }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: bazel-contrib/setup-bazel@104e3eea9447cdaa4b00d0fb46191a3985d26ab3 # 0.19.1
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- run: bazel build //...
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pre-commit/action@v3.0.1
# For branch protection settings, this job provides a "stable" name that can be used to gate PR merges
# on "all matrix jobs were successful".
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/conventional-commits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This helps the tag.yaml action to automatically create new releases
#
# tag.yaml requires all commits to follow the conventional commit pattern so that it can
# automatically derive the next release version based on the commit history
name: Verify PR title/description
on:
pull_request_target:
types:
- opened
- edited
- synchronize
permissions:
pull-requests: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 16 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@ permissions:
contents: write
jobs:
release:
uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v7.3.0
# https://github.com/bazel-contrib/.github/blob/master/.github/workflows/release_ruleset.yaml
uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v7.7.0
with:
release_files: rules_tensorrt_rtx-*.tar.gz
prerelease: false
# Open the release as a draft to support immutable GitHub releases.
# Attestations will be uploaded to the draft in publish.yaml.
# See:
# https://docs.github.com/en/code-security/concepts/supply-chain-security/immutable-releases.
# https://github.com/bazel-contrib/publish-to-bcr#immutable-releases
draft: true
tag_name: ${{ inputs.tag_name || github.ref_name }}
bazel_test_command: "bazel build //..."
publish:
Expand All @@ -33,3 +40,11 @@ jobs:
tag_name: ${{ inputs.tag_name || github.ref_name }}
secrets:
publish_token: ${{ secrets.publish_token || secrets.BCR_PUBLISH_TOKEN }}
finalize:
# Publish the draft release
needs: publish
runs-on: ubuntu-latest
steps:
- uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
tag_name: ${{ inputs.tag_name || github.ref_name }}
18 changes: 2 additions & 16 deletions .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,11 @@ git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')

cat << EOF
## Using Bzlmod with Bazel 6 or greater
## Bzlmod

1. (Bazel 6 only) Enable with \`common --enable_bzlmod\` in \`.bazelrc\`.
2. Add to your \`MODULE.bazel\` file:
Add to your \`MODULE.bazel\` file:

\`\`\`starlark
bazel_dep(name = "rules_tensorrt_rtx", version = "${TAG:1}")
\`\`\`

## Using WORKSPACE

Paste this snippet into your \`WORKSPACE.bazel\` file:

\`\`\`starlark
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_tensorrt_rtx",
sha256 = "${SHA}",
strip_prefix = "${PREFIX}",
url = "https://github.com/wep21/rules_tensorrt_rtx/releases/download/${TAG}/${ARCHIVE}",
)
EOF
11 changes: 6 additions & 5 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
outputs:
new-tag: ${{ steps.ccv.outputs.new-tag }}
new-tag-version: ${{steps.ccv.outputs.new-tag-version}}
new-tag-version-type: ${{steps.ccv.outputs.new-tag-version-type}}
recently-tagged: ${{steps.recent-tag.outputs.recently-tagged}}
new-tag-version: ${{ steps.ccv.outputs.new-tag-version }}
new-tag-version-type: ${{ steps.ccv.outputs.new-tag-version-type }}
recently-tagged: ${{ steps.recent-tag.outputs.recently-tagged }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Need enough history to find the prior release tag
fetch-depth: 0
Expand All @@ -47,6 +47,7 @@ jobs:
fi
- name: Bump tag if necessary
id: ccv
if: github.event_name != 'schedule' || steps.recent-tag.outputs.recently-tagged != 'true'
uses: smlx/ccv@7318e2f25a52dcd550e75384b84983973251a1f8 # v0.10.0
release:
needs: tag
Expand All @@ -55,7 +56,7 @@ jobs:
tag_name: ${{ needs.tag.outputs.new-tag-version }}
secrets:
publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }}
if: needs.tag.outputs.new-tag == 'true' && needs.tag.outputs.new-tag-version-type != 'major' && needs.tag.outputs.recently-tagged != 'true'
if: needs.tag.outputs.new-tag == 'true' && needs.tag.outputs.new-tag-version-type != 'major'
permissions:
contents: write
id-token: write
Expand Down
Loading