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
9 changes: 9 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:

permissions: {}

env:
REGISTRY: ghcr.io

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -21,6 +24,12 @@ jobs:
version: '2.25.1'
platform: 'linux64'
checksum: '4f070e6cc7009e75aec307ed109c2fcf0501e579c20a31080b893e31209523d5'
- name: Log in to the Container registry
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: make test
- run: make publish
env:
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,13 @@ make pack-upgrade
make test format
make generate-table generate-help
```

## Release

1. Ensure all `qlpack.yml` files have the correct version.

```shell
./scripts/update-version.sh <version>
```

1. Create a release on GitHub, create a new tag, and autogenerate release notes.
2 changes: 1 addition & 1 deletion go/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: trailofbits/go-queries
description: CodeQL queries for Go developed by Trail of Bits
authors: Trail of Bits
version: 0.2.1
version: 0.3.0
license: AGPL
library: false
extractor: go
Expand Down
2 changes: 1 addition & 1 deletion java/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: trailofbits/java-queries
description: CodeQL queries for Java developed by Trail of Bits
authors: Trail of Bits
version: 0.0.1
version: 0.3.0
license: AGPL
library: false
extractor: java-kotlin
Expand Down
40 changes: 40 additions & 0 deletions scripts/update-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -euo pipefail

if [[ $# -ne 1 ]]; then
echo "Usage: $0 <version>" >&2
echo "Example: $0 0.4.0" >&2
exit 1
fi

version="$1"

if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: version must be semver (X.Y.Z), got: $version" >&2
exit 1
fi

packs=(
cpp/lib/qlpack.yml
cpp/src/qlpack.yml
go/src/qlpack.yml
java/src/qlpack.yml
)

for f in "${packs[@]}"; do
if [[ ! -f "$f" ]]; then
echo "Error: file not found: $f (run from repo root)" >&2
exit 1
fi
if ! grep -q '^version: ' "$f"; then
echo "Error: no 'version:' line in $f" >&2
exit 1
fi
done

for f in "${packs[@]}"; do
tmp="$(mktemp)"
sed "s/^version: .*/version: $version/" "$f" >"$tmp"
mv "$tmp" "$f"
echo "Updated $f -> $version"
done
Loading