chore(ci): approve esbuild dependency build

This commit is contained in:
2026-08-05 01:23:06 -03:00
parent f13fd6d96b
commit bbab0e8801
7 changed files with 2932 additions and 19 deletions
-2
View File
@@ -2,8 +2,6 @@ when:
- event: pull_request - event: pull_request
- event: push - event: push
branch: main branch: main
- event: tag
ref: refs/tags/v*
steps: steps:
verify: verify:
+21 -14
View File
@@ -1,31 +1,38 @@
# Release workflow: derive the version, changelog, tag, and package from Conventional Commits on main.
when: when:
- event: tag - event: push
ref: refs/tags/v* branch: main
depends_on: depends_on:
- ci - ci
clone:
depth: 0
steps: steps:
publish: release:
image: node:24-bookworm-slim image: node:24-bookworm-slim
environment: environment:
GITEA_PACKAGE_TOKEN: GITEA_PACKAGE_TOKEN:
from_secret: gitea_package_token from_secret: gitea_package_token
GITEA_REGISTRY_USERNAME:
from_secret: gitea_registry_username
GITEA_RELEASE_TOKEN:
from_secret: gitea_release_token
commands: commands:
- corepack enable - corepack enable
- corepack prepare pnpm@11.0.0 --activate - corepack prepare pnpm@11.0.0 --activate
- pnpm install --frozen-lockfile - pnpm install --frozen-lockfile
- pnpm check - git config user.name "Woodpecker CI"
- pnpm test - git config user.email "woodpecker-ci@mifi.dev"
- pnpm build - git remote set-url origin "https://${GITEA_REGISTRY_USERNAME}:${GITEA_RELEASE_TOKEN}@git.mifi.dev/mifi/logger.git"
- test "v$(node -p "require('./package.json').version")" = "$CI_COMMIT_TAG"
- npm config set @mifi:registry https://git.mifi.dev/api/packages/mifi/npm/ - npm config set @mifi:registry https://git.mifi.dev/api/packages/mifi/npm/
- npm config set -- //git.mifi.dev/api/packages/mifi/npm/:_authToken "$GITEA_PACKAGE_TOKEN" - npm config set -- //git.mifi.dev/api/packages/mifi/npm/:_authToken "$GITEA_PACKAGE_TOKEN"
- pnpm publish --no-git-checks - pnpm release
notify-publish-failure: notify-release-failure:
image: curlimages/curl:8.14.1 image: curlimages/curl:8.14.1
depends_on: [publish] depends_on: [release]
environment: environment:
MATTERMOST_BOT_ACCESS_TOKEN: MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: mattermost_bot_access_token from_secret: mattermost_bot_access_token
@@ -35,14 +42,14 @@ steps:
from_secret: mattermost_post_api_url from_secret: mattermost_post_api_url
commands: commands:
- | - |
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Package publish failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER") BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Package release failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl --fail --show-error --silent --request POST --header 'Content-Type: application/json' --header "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" --data "$BODY" "$MATTERMOST_POST_API_URL" curl --fail --show-error --silent --request POST --header 'Content-Type: application/json' --header "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" --data "$BODY" "$MATTERMOST_POST_API_URL"
when: when:
- status: [failure] - status: [failure]
notify-publish-success: notify-release-success:
image: curlimages/curl:8.14.1 image: curlimages/curl:8.14.1
depends_on: [publish] depends_on: [release]
environment: environment:
MATTERMOST_BOT_ACCESS_TOKEN: MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: mattermost_bot_access_token from_secret: mattermost_bot_access_token
@@ -52,7 +59,7 @@ steps:
from_secret: mattermost_post_api_url from_secret: mattermost_post_api_url
commands: commands:
- | - |
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Package publish success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER") BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Package release success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl --fail --show-error --silent --request POST --header 'Content-Type: application/json' --header "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" --data "$BODY" "$MATTERMOST_POST_API_URL" curl --fail --show-error --silent --request POST --header 'Content-Type: application/json' --header "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" --data "$BODY" "$MATTERMOST_POST_API_URL"
when: when:
- status: [success] - status: [success]
+6 -2
View File
@@ -32,6 +32,10 @@ import { createSentrySink } from "@mifi/logger/sentry";
const logger = createLogger({ environment: "production", sentry: createSentrySink(Sentry) }); const logger = createLogger({ environment: "production", sentry: createSentrySink(Sentry) });
``` ```
## Publishing ## Releases
Woodpecker verifies pull requests, `main`, and version tags, and reports CI to Mattermost. To publish, push a tag matching the package version (for example, `v0.9.1`). The tag build verifies the package before publishing it to the private `@mifi` registry and reports the result to Mattermost. It uses the existing global `gitea_package_token`, `mattermost_bot_access_token`, `mattermost_tests_channel_id`, `mattermost_pushes_channel_id`, and `mattermost_post_api_url` secrets. Woodpecker verifies pull requests and `main`, reports CI to Mattermost, then automatically releases from Conventional Commits merged to `main`. It updates `package.json` and `CHANGELOG.md`, creates a `vX.Y.Z` tag, and publishes to the private `@mifi` registry.
Use `fix:` for a patch, `feat:` for a minor release, and `!` or a `BREAKING CHANGE:` footer for a major release. Commits such as `docs:`, `test:`, and `chore:` do not release a package. Before enabling the automation, publish and tag the existing `v0.9.1` once as its baseline.
The release workflow uses the existing global `gitea_package_token`, `gitea_registry_username`, `gitea_release_token`, `mattermost_bot_access_token`, `mattermost_tests_channel_id`, `mattermost_pushes_channel_id`, and `mattermost_post_api_url` secrets.
+9 -1
View File
@@ -2,6 +2,10 @@
"name": "@mifi/logger", "name": "@mifi/logger",
"version": "0.9.1", "version": "0.9.1",
"description": "Intentional, namespaced logging for browser and Node.js TypeScript applications.", "description": "Intentional, namespaced logging for browser and Node.js TypeScript applications.",
"repository": {
"type": "git",
"url": "https://git.mifi.dev/mifi/logger.git"
},
"type": "module", "type": "module",
"sideEffects": false, "sideEffects": false,
"packageManager": "pnpm@11.0.0", "packageManager": "pnpm@11.0.0",
@@ -34,13 +38,17 @@
"lint": "oxlint src test", "lint": "oxlint src test",
"test": "vitest run", "test": "vitest run",
"test:watch": "vitest", "test:watch": "vitest",
"pack:check": "pnpm pack --pack-destination .artifacts" "pack:check": "pnpm pack --pack-destination .artifacts",
"release": "semantic-release"
}, },
"devDependencies": { "devDependencies": {
"@semantic-release/changelog": "^7.0.0",
"@semantic-release/git": "^11.0.1",
"@types/node": "^24.0.0", "@types/node": "^24.0.0",
"@vitest/coverage-v8": "^3.0.0", "@vitest/coverage-v8": "^3.0.0",
"oxlint": "^1.0.0", "oxlint": "^1.0.0",
"prettier": "^3.5.0", "prettier": "^3.5.0",
"semantic-release": "^25.0.8",
"tsup": "^8.4.0", "tsup": "^8.4.0",
"typescript": "^6.0.0", "typescript": "^6.0.0",
"vitest": "^3.0.0" "vitest": "^3.0.0"
+2876
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -0,0 +1,3 @@
# tsup and Vitest require esbuild's platform-specific binary during development and CI.
allowBuilds:
esbuild: true
+17
View File
@@ -0,0 +1,17 @@
module.exports = {
branches: ["main"],
tagFormat: "v${version}",
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", { changelogFile: "CHANGELOG.md" }],
"@semantic-release/npm",
[
"@semantic-release/git",
{
assets: ["CHANGELOG.md", "package.json", "pnpm-lock.yaml"],
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
},
],
],
};