Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
474614a
chore: versioning workflow baseline setup
Vaz-Tiago Oct 8, 2025
d27f063
chore(release): publish v0.10.0
Vaz-Tiago Oct 8, 2025
6ad8b82
test: stabilize Main.test.tsx using findByPlaceholderText for async r…
Vaz-Tiago Oct 8, 2025
a6ca1ff
ci: fix canary workflow detached HEAD (checkout PR ref + push tags)
Vaz-Tiago Oct 8, 2025
5b2cc96
chore(release): publish v0.10.1-next.0
github-actions[bot] Oct 8, 2025
9f7ab33
ci: fix github-script comment API usage (use github.rest.issues.creat…
Vaz-Tiago Oct 8, 2025
a850d3d
chore(release): publish v0.10.1-next.1
github-actions[bot] Oct 8, 2025
fc21ec7
ci: rename test job to include node version for clarity
Vaz-Tiago Oct 8, 2025
f4bd141
chore(release): publish v0.10.1-next.2
github-actions[bot] Oct 8, 2025
7e9dc31
ci: revert test job name to satisfy branch protection
Vaz-Tiago Oct 8, 2025
b78e06f
chore(release): publish v0.10.1-next.3
github-actions[bot] Oct 8, 2025
4af782f
ci(test-libs): run all package tests unconditionally to debug branch …
Vaz-Tiago Oct 8, 2025
5300557
chore(release): publish v0.10.1-next.4
github-actions[bot] Oct 8, 2025
38947a7
test(vitest): lower functions coverage threshold 80 -> 70
Vaz-Tiago Oct 8, 2025
0b02c07
chore(release): publish v0.10.1-next.5
github-actions[bot] Oct 8, 2025
a76f1a4
ci(workflows): restore conditional test steps and remove diff links f…
Vaz-Tiago Oct 8, 2025
8bbe564
chore(release): publish v0.10.1-next.6
github-actions[bot] Oct 8, 2025
2d540de
ci(canary): remove commit bump; use ephemeral version base-next.<sha>…
Vaz-Tiago Oct 9, 2025
086bce8
chore(baseline): normalize all package versions to 0.9.6 and update i…
Vaz-Tiago Oct 9, 2025
4f19af5
chore(canary): trigger test & canary publish with touch file
Vaz-Tiago Oct 9, 2025
ac5dfbf
ci(workflows): chain canary after tests & adjust test workflow trigger
Vaz-Tiago Oct 9, 2025
8359268
ci(test-libs): fix pull_request trigger (remove invalid branch and ad…
Vaz-Tiago Oct 9, 2025
7ea1353
ci(canary): revert to inline tests + conditional publish on success
Vaz-Tiago Oct 9, 2025
df1b9ef
ci(canary): add ephemeral commit/reset to fix lerna EUNCOMMIT for pub…
Vaz-Tiago Oct 9, 2025
a5947f3
ci(canary): valida publicação no NPM antes de comentar versão canary …
Vaz-Tiago Oct 9, 2025
d421b25
ci(canary): remove validação NPM quebrada do step de publish
Vaz-Tiago Oct 9, 2025
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
172 changes: 172 additions & 0 deletions .github/workflows/canary-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
name: Canary

on:
pull_request:
branches: [main, latest]
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch: {}

permissions:
contents: write
pull-requests: write
packages: write

concurrency:
group: canary-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
canary:
name: Canary publish (tests + publish next)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: yarn
- name: Setup npm auth
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
npm whoami || true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install deps
run: yarn install --frozen-lockfile
- name: Build libs
run: yarn build:libs
- name: Test client-core (aggregate)
run: |
set +e
yarn test:client-core:coverage
RC=$?
if [ $RC -ne 0 ]; then echo client-core >> failed-tests.txt; fi
exit 0
- name: Report Client Core Coverage
if: always()
uses: davelosert/vitest-coverage-report-action@v2
with:
name: client-core
json-summary-path: coverage/coverage-summary.json
json-final-path: coverage/coverage-final.json
- name: Test client (aggregate)
run: |
set +e
yarn test:client:coverage
RC=$?
if [ $RC -ne 0 ]; then echo client >> failed-tests.txt; fi
exit 0
- name: Report Client Coverage
if: always()
uses: davelosert/vitest-coverage-report-action@v2
with:
name: client
json-summary-path: coverage/coverage-summary.json
json-final-path: coverage/coverage-final.json
- name: Test validators (aggregate)
run: |
set +e
yarn test:validators:coverage
RC=$?
if [ $RC -ne 0 ]; then echo validators >> failed-tests.txt; fi
exit 0
- name: Report Validators Coverage
if: always()
uses: davelosert/vitest-coverage-report-action@v2
with:
name: validators
json-summary-path: coverage/coverage-summary.json
json-final-path: coverage/coverage-final.json
- name: Evaluate aggregated test result
run: |
if [ -f failed-tests.txt ]; then
echo "::error::Falhas em pacotes de teste:";
cat failed-tests.txt | sed 's/^/- /';
echo "Marcando job como failed";
exit 1;
else
echo "Todos os testes passaram em todos os pacotes";
fi
- name: Compute ephemeral canary version
if: success()
id: version
run: |
BASE_VERSION=$(node -p 'require("./lerna.json").version')
SHORT_SHA=$(git rev-parse --short HEAD)
EPHEMERAL_VERSION="${BASE_VERSION}-next.${SHORT_SHA}.${GITHUB_RUN_ATTEMPT}"
echo "EPHEMERAL_VERSION=$EPHEMERAL_VERSION" >> $GITHUB_ENV
echo "EPHEMERAL_VERSION=$EPHEMERAL_VERSION" >> $GITHUB_OUTPUT
- name: Inject ephemeral version in packages
if: success()
run: |
EPV="$EPHEMERAL_VERSION"
echo "Aplicando versão efêmera $EPV nos package.json (sem commit)"
jq --arg v "$EPV" '.version = $v' lerna.json > lerna.tmp && mv lerna.tmp lerna.json
for PKG in packages/*/package.json; do
jq --arg v "$EPV" '.version = $v' "$PKG" > "$PKG.tmp" && mv "$PKG.tmp" "$PKG" || exit 1
done
- name: Git identity for ephemeral commit
if: success()
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Ephemeral commit (local, not pushed)
if: success()
run: |
echo "HEAD_ORIG=$(git rev-parse HEAD)" >> $GITHUB_ENV
git add lerna.json packages/*/package.json || true
if git diff --cached --quiet; then
echo "Sem mudanças para commit (rerun?)"
else
git commit -m "chore(ci): ephemeral canary version $EPHEMERAL_VERSION" || true
fi
git status --short
- name: Publish canary (no commit/tag)
if: success()
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npx lerna publish from-package --dist-tag next --yes --no-verify-access || echo "Nenhum pacote alterado para publicar (ok)"
echo "CURRENT_VERSION=$EPHEMERAL_VERSION" >> $GITHUB_ENV

- name: Revert ephemeral commit (keep tree clean for PR)
if: success()
run: |
if [ -n "$HEAD_ORIG" ]; then
git reset --hard "$HEAD_ORIG" || true
git status --short
fi
- name: PR Success Comment
if: success()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const curr = process.env.CURRENT_VERSION;
const number = context.payload.pull_request.number;
const body = `Canary publicado: v${curr}`;
await github.rest.issues.createComment({
issue_number: number,
owner: context.repo.owner,
repo: context.repo.repo,
body
});
- name: PR Failure Comment
if: failure()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const number = context.payload.pull_request.number;
const body = 'Canary não publicado: testes falharam. Verifique os logs do workflow.';
await github.rest.issues.createComment({
issue_number: number,
owner: context.repo.owner,
repo: context.repo.repo,
body
});
66 changes: 66 additions & 0 deletions .github/workflows/minor-release-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Minor Release (merge main -> latest)

on:
pull_request:
types: [closed]
branches:
- latest

permissions:
contents: write
pull-requests: write
packages: write

jobs:
minor:
if: github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'main'
runs-on: ubuntu-latest
name: Minor publish
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: yarn
- name: Git identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Setup npm auth
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
npm whoami || true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install
run: yarn install --frozen-lockfile
- name: Build libs
run: yarn build:libs
- name: Minor version & publish
id: minor
run: |
yarn publish:minor
VERSION=$(node -p 'require("./lerna.json").version')
echo "CURRENT_VERSION=$VERSION" >> $GITHUB_ENV
echo "PREVIOUS_TAG=$(git describe --tags --abbrev=0 --exclude $VERSION 2>/dev/null || echo '')" >> $GITHUB_ENV
- name: PR Comment
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const curr = `v${process.env.CURRENT_VERSION}`;
const body = `Minor release publicado: ${curr}`;
if (!context.issue.number) {
core.warning('Sem issue/PR number detectado para comentar.');
} else {
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body
});
}
66 changes: 66 additions & 0 deletions .github/workflows/patch-release-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Patch Release (merge -> main)

on:
pull_request:
types: [closed]
branches:
- main

permissions:
contents: write
pull-requests: write
packages: write

jobs:
patch:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
name: Patch publish
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: yarn
- name: Git identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Setup npm auth
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
npm whoami || true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install
run: yarn install --frozen-lockfile
- name: Build libs
run: yarn build:libs
- name: Patch version & publish
id: patch
run: |
yarn publish:patch
VERSION=$(node -p 'require("./lerna.json").version')
echo "CURRENT_VERSION=$VERSION" >> $GITHUB_ENV
echo "PREVIOUS_TAG=$(git describe --tags --abbrev=0 --exclude $VERSION 2>/dev/null || echo '')" >> $GITHUB_ENV
- name: PR Comment
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const curr = `v${process.env.CURRENT_VERSION}`;
const body = `Patch release publicado: ${curr}`;
if (!context.issue.number) {
core.warning('Sem issue/PR number detectado para comentar.');
} else {
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body
});
}
42 changes: 4 additions & 38 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,16 @@ on:
types: [closed]
branches:
- main
workflow_dispatch: {}

permissions:
contents: write # for checkout and tag
pull-requests: write # for comments
packages: write # for publish

jobs:
publish:
if: github.event.pull_request.merged == true
name: Pre-release
disabled:
runs-on: ubuntu-latest
if: false
steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "Setup do nodejs"
uses: actions/setup-node@v3
with:
node-version: 20
cache: "yarn"

- name: Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup npm env
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
npm whoami
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Install
run: yarn install
- name: Build libs
run: yarn build:libs
- name: Bump versions and publish packages
run: |
yarn publish:canary
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo "Workflow legacy desativado. Use canary-main.yml / patch-release-main.yml / minor-release-latest.yml"
Loading
Loading