-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): release-plz + cocogitto + tooling de release per-crate #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JaimeJunr
wants to merge
9
commits into
main
Choose a base branch
from
chore/release-workflow-v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8e29055
chore(cli): bump serverust-cli 0.1.6 -> 0.3.0 (align workspace)
JaimeJunr b2034d3
chore(release): tooling pós-v0.3.0 — cargo-release + cargo-deny + per…
JaimeJunr 2f47f47
feat(ci): release-plz + cocogitto + cargo-nextest + cargo-machete
JaimeJunr 57fef94
fix(ci): endereça 5 fails do pipeline release-plz/tooling
JaimeJunr 89455dd
fix(ci): reorder cog.toml — global keys before [commit_types] table
JaimeJunr e786b98
fix(ci): allow-wildcard-paths para examples publish=false
JaimeJunr 08947ec
fix(ci): ignore 3 RUSTSEC advisories em rustls-webpki 0.101.7 transitive
JaimeJunr f6bfd18
chore(dev): otimiza profile.dev — line-tables-only + split-debuginfo …
JaimeJunr 25afcf8
Potential fix for pull request finding
JaimeJunr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: cargo-deny | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "**/Cargo.toml" | ||
| - "Cargo.lock" | ||
| - "deny.toml" | ||
| - ".github/workflows/cargo-deny.yml" | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "**/Cargo.toml" | ||
| - "Cargo.lock" | ||
| - "deny.toml" | ||
| schedule: | ||
| # Roda semanalmente para pegar advisories novas mesmo sem mudanças. | ||
| - cron: "23 5 * * 1" # segunda 05:23 UTC | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: EmbarkStudios/cargo-deny-action@v2 | ||
| with: | ||
| # `check all` = advisories + licenses + bans + sources. | ||
| command: check all | ||
| arguments: --workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: cargo-machete | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "**/Cargo.toml" | ||
| - "**/Cargo.lock" | ||
| - "**/*.rs" | ||
| - ".github/workflows/cargo-machete.yml" | ||
| schedule: | ||
| # Cron semanal para pegar deps removidas/órfãs no ecossistema. | ||
| - cron: "17 6 * * 1" | ||
|
|
||
| jobs: | ||
| machete: | ||
| name: Find unused dependencies | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: bnjbvr/cargo-machete@main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: commitlint | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, edited, reopened, synchronize] | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| cog-check: | ||
| name: Conventional Commits (cocogitto) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # cog precisa histórico completo | ||
| - name: Install cocogitto | ||
| # cargo-binstall pega binary release oficial direto do GitHub releases. | ||
| # Mais confiável que install.sh (que retornou 404 em 2026-05). | ||
| uses: taiki-e/install-action@v2 | ||
| with: | ||
| tool: cocogitto | ||
| - name: Validate commit history | ||
| # Em PR: valida só os commits da PR (from-latest-tag = false). | ||
| # Em push para main: cog check valida tudo desde o último tag. | ||
| run: | | ||
| if [ "${{ github.event_name }}" = "pull_request" ]; then | ||
| git fetch origin ${{ github.base_ref }} | ||
| cog check origin/${{ github.base_ref }}..HEAD | ||
| else | ||
| cog check | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: release-plz | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| # workflow_dispatch permite trigger manual via UI ("Run workflow") — útil | ||
| # para forçar release após hot-fix. | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
| contents: write | ||
|
|
||
| jobs: | ||
| release-plz-release: | ||
| name: release-plz / release | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: release-plz/action@v0.5 | ||
| with: | ||
| command: release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
|
|
||
| release-plz-pr: | ||
| name: release-plz / release-pr | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'push' | ||
| concurrency: | ||
| # Cancela release-pr anterior se um novo push chegar — evita PRs duplicados. | ||
| group: release-plz-${{ github.ref }} | ||
| cancel-in-progress: false | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: release-plz/action@v0.5 | ||
| with: | ||
| command: release-pr | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| name: tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| nextest: | ||
| name: cargo nextest (${{ matrix.crate }} / features=${{ matrix.features }}) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| # Rodamos por crate para isolar falhas e respeitar a regra "nunca workspace | ||
| # build inteiro de uma vez" (CLAUDE.md). nextest é mais rápido por design | ||
| # (parallelism + retry). | ||
| matrix: | ||
| include: | ||
| - crate: serverust-macros | ||
| features: "" | ||
| - crate: serverust-core | ||
| features: "" | ||
| - crate: serverust-telemetry | ||
| features: "" | ||
| - crate: serverust-events | ||
| features: "" | ||
| - crate: serverust-events | ||
| features: "sqs in-memory" | ||
| - crate: serverust-events | ||
| features: "kafka" | ||
| - crate: serverust-events | ||
| features: "asyncapi sqs" | ||
| - crate: serverust-lambda | ||
| features: "" | ||
| - crate: serverust-cli | ||
| features: "" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| # Cache key inclui matrix para isolar caches por crate+features. | ||
| shared-key: "tests-${{ matrix.crate }}-${{ matrix.features }}" | ||
| - name: Install librdkafka build deps (kafka feature) | ||
| if: contains(matrix.features, 'kafka') | ||
| # libcurl4-openssl-dev: rdkafka-sys >=4.10 requer curl/curl.h em build. | ||
| run: sudo apt-get update && sudo apt-get install -y cmake build-essential libssl-dev libsasl2-dev libcurl4-openssl-dev | ||
| - name: Install cargo-nextest | ||
| uses: taiki-e/install-action@v2 | ||
| with: | ||
| tool: cargo-nextest | ||
| - name: Run tests | ||
| run: | | ||
| if [ -z "${{ matrix.features }}" ]; then | ||
| cargo nextest run -p ${{ matrix.crate }} | ||
| else | ||
| cargo nextest run -p ${{ matrix.crate }} --features "${{ matrix.features }}" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # Configuração do git-cliff (https://git-cliff.org). | ||
| # | ||
| # Usado pelo release-plz para gerar CHANGELOG.md a partir de Conventional Commits. | ||
| # Também pode ser rodado standalone: `git cliff -o CHANGELOG.md` | ||
|
|
||
| [changelog] | ||
| header = """ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| """ | ||
| body = """ | ||
| {% if version %}\ | ||
| ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} | ||
| {% else %}\ | ||
| ## [Unreleased] | ||
| {% endif %}\ | ||
| {% for group, commits in commits | group_by(attribute="group") %} | ||
| ### {{ group | upper_first }} | ||
| {% for commit in commits %} | ||
| - {% if commit.breaking %}[**BREAKING**] {% endif %}{{ commit.message | upper_first }} ({{ commit.id | truncate(length=7, end="") }})\ | ||
| {% endfor %} | ||
| {% endfor %} | ||
| """ | ||
| trim = true | ||
| footer = """ | ||
| [unreleased]: https://github.com/JaimeJunr/serverust/compare/{{ previous.version }}...HEAD | ||
| """ | ||
|
|
||
| [git] | ||
| conventional_commits = true | ||
| filter_unconventional = true | ||
| split_commits = false | ||
| commit_parsers = [ | ||
| { message = "^feat", group = "Added" }, | ||
| { message = "^fix", group = "Fixed" }, | ||
| { message = "^perf", group = "Performance" }, | ||
| { message = "^doc", group = "Documentation" }, | ||
| { message = "^refactor", group = "Refactor" }, | ||
| { message = "^test", group = "Tests" }, | ||
| { message = "^build", group = "Build" }, | ||
| { message = "^ci", group = "CI" }, | ||
| { message = "^chore\\(release\\)", skip = true }, | ||
| { message = "^chore", group = "Chore" }, | ||
| { message = "^revert", group = "Revert" }, | ||
| ] | ||
| protect_breaking_commits = true | ||
| filter_commits = false | ||
| tag_pattern = "^[a-z-]+-v[0-9]+\\.[0-9]+\\.[0-9]+$" | ||
| skip_tags = "v0.1.0|v0.2.0" # tags legadas pré-per-crate | ||
| ignore_tags = "" | ||
| topo_order = false | ||
| sort_commits = "newest" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Configuração do cocogitto (https://docs.cocogitto.io). | ||
| # | ||
| # cocogitto é o linter de Conventional Commits Rust-native. | ||
| # Usado pelo lefthook (commit-msg hook) e pelo CI (.github/workflows/commitlint.yml). | ||
| # | ||
| # Validar histórico: cog check | ||
| # Validar próximo commit message: cog verify "feat(scope): message" | ||
|
|
||
| # ─── Chaves globais (devem vir ANTES de qualquer [table]) ────────────────── | ||
|
|
||
| # Política do tag — bate com release-plz. | ||
| tag_prefix = "" | ||
|
|
||
| # Permite merge commits e revert commits sem enforcement estrito. | ||
| ignore_merge_commits = true | ||
|
|
||
| # Branch base. cog check valida histórico contra a branch atual. | ||
| branch_whitelist = ["main", "release-plz/*", "ralph/*", "ci/*", "chore/*", "fix/*", "feat/*", "docs/*"] | ||
|
|
||
| # Hooks pós-bump (vazio = sem hooks customizados). | ||
| post_bump_hooks = [] | ||
|
|
||
| # Scopes recomendados (monorepo). Lista vazia = qualquer scope aceito; | ||
| # descomente para enforcement estrito. | ||
| # scopes = ["core", "macros", "events", "telemetry", "lambda", "cli", "examples", "docs", "ci"] | ||
|
|
||
| # ─── Tipos de commit ─────────────────────────────────────────────────────── | ||
| # Conventional Commits v1.0 + Angular convention. | ||
| [commit_types] | ||
| feat = { changelog_title = "Features" } | ||
| fix = { changelog_title = "Bug Fixes" } | ||
| perf = { changelog_title = "Performance" } | ||
| refactor = { changelog_title = "Refactoring" } | ||
| docs = { changelog_title = "Documentation" } | ||
| test = { changelog_title = "Tests" } | ||
| build = { changelog_title = "Build System" } | ||
| ci = { changelog_title = "Continuous Integration" } | ||
| chore = { changelog_title = "Chores" } | ||
| revert = { changelog_title = "Reverts" } | ||
| style = { changelog_title = "Style" } | ||
|
|
||
| # ─── Changelog (usado pelo `cog changelog`) ──────────────────────────────── | ||
| [changelog] | ||
| authors = [] | ||
| template = "remote" | ||
| remote = "github.com" | ||
| repository = "serverust" | ||
| owner = "JaimeJunr" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.