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
1 change: 0 additions & 1 deletion .github/CODEOWNERS

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,18 @@ jobs:
env:
GITHUB_REF_NAME: ${{ github.ref_name }}

- name: Check if version already published
run: |
VERSION="$(node -e "console.log(JSON.parse(require('fs').readFileSync('package.json','utf8')).version)")"
if npm view "codebase-context@${VERSION}" version >/dev/null 2>&1; then
echo "Version ${VERSION} already exists on npm; skipping publish."
echo "SKIP_PUBLISH=true" >> "$GITHUB_ENV"
else
echo "Version ${VERSION} not found on npm; will publish."
fi

- name: Quality gates
if: env.SKIP_PUBLISH != 'true'
run: |
pnpm lint
pnpm format:check
Expand All @@ -44,6 +55,7 @@ jobs:
pnpm build

- name: Publish
if: env.SKIP_PUBLISH != 'true'
run: pnpm publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 3 additions & 2 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
permissions:
contents: write
pull-requests: write
issues: write

jobs:
release-please:
Expand All @@ -15,5 +16,5 @@ jobs:
steps:
- uses: googleapis/release-please-action@v4
with:
release-type: node
package-name: codebase-context
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.4.0"
}
5 changes: 4 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ We use a clean OSS-style flow:
- Require PRs (no direct pushes)
- Require the `Tests` workflow to pass

This repo also uses `CODEOWNERS` so PRs from non-owners require an approval from `@PatrickSys`.
3. Allow Release Please to open PRs
- GitHub: Settings > Actions > General
- Set Workflow permissions to "Read and write"
- Enable "Allow GitHub Actions to create and approve pull requests"

## Normal release flow

Expand Down
12 changes: 12 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"packages": {
".": {
"release-type": "node",
"package-name": "codebase-context",
"changelog-path": "CHANGELOG.md",
"include-v-in-tag": true,
"include-component-in-tag": false,
"extra-files": ["pnpm-lock.yaml"]
}
}
}
Loading