From cb25f5c2da9d8e9adba4255cd8772f96b3c9c542 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Tue, 20 Aug 2024 16:04:55 -0600 Subject: [PATCH] validator: add tag prefix to seperate cli tags from schema tags --- .../workflows/{release.yml => validator-release.yml} | 2 +- dist.toml | 2 ++ validator/README.md | 10 ++++++++++ validator/main.go | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) rename .github/workflows/{release.yml => validator-release.yml} (99%) diff --git a/.github/workflows/release.yml b/.github/workflows/validator-release.yml similarity index 99% rename from .github/workflows/release.yml rename to .github/workflows/validator-release.yml index a00892e..626ce80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/validator-release.yml @@ -40,7 +40,7 @@ on: pull_request: push: tags: - - '**[0-9]+.[0-9]+.[0-9]+*' + - 'validator**[0-9]+.[0-9]+.[0-9]+*' jobs: # Run 'cargo dist plan' (or host) to determine what tasks we need to do diff --git a/dist.toml b/dist.toml index 612ed86..5dcc2cd 100644 --- a/dist.toml +++ b/dist.toml @@ -22,6 +22,8 @@ targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux- install-path = ["$OTEL_CONFIG_VALIDATOR_HOME/bin", "~/.local/bin"] # Publish jobs to run in CI pr-run-mode = "plan" +# A prefix git tags must include for cargo-dist to care about them +tag-namespace = "validator" # Whether to install an updater program install-updater = false diff --git a/validator/README.md b/validator/README.md index f4c88e7..2e9b936 100644 --- a/validator/README.md +++ b/validator/README.md @@ -80,3 +80,13 @@ Running the tests of the compiled CLI requires $ shelltest -c --diff --all shelltests/*.test ``` +### Releasing + +To release a new version of `otel_config_validator` the version in `dist.toml` +and the `Version` property of `cli.Comamnd` in `main.go` must be bumped. Next, a +tag prefixed with `validator-` must be created and pushed to the repository, for +example `validator-0.1.0`. Then, the `cargo-dist` Github Action will create a +Github release, build binaries for multiple platforms and publish them to the +new release. + +Docker image are published on merge to `main`. diff --git a/validator/main.go b/validator/main.go index 536762f..8d4fa5f 100644 --- a/validator/main.go +++ b/validator/main.go @@ -27,6 +27,7 @@ func main() { cmd := &cli.Command{ Name: "otel_config_validator", Usage: "Validate a configuration file against the OpenTelemetry Configuration Schema", + Version: "0.1.0", Flags: []cli.Flag{ &cli.StringFlag{ Name: "output",