Repository navigation
fix: Fix release workflow - #3
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #3 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 246 246
Branches 68 60 -8
=========================================
Hits 246 246
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request removes automated semantic-release in favor of a manual release process. The changes shift from automated version bumping and changelog generation to a manual approach where developers must update versions and changelog entries themselves.
Changes:
- Removed semantic-release and related plugins from dependencies
- Deleted .releaserc.json configuration file
- Updated release workflow to verify changelog entries and publish directly using pnpm
- Added changelog verification step to CI workflow for pull requests with version changes
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Removed semantic-release and associated plugins from devDependencies |
| pnpm-lock.yaml | Removed all dependencies related to semantic-release ecosystem (hundreds of transitive dependencies) |
| .releaserc.json | Deleted semantic-release configuration file |
| .github/workflows/release.yml | Replaced semantic-release automation with manual changelog verification and pnpm publish command |
| .github/workflows/ci.yml | Added changelog verification for PRs that bump the version |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| run: | | ||
| pnpm config set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }} | ||
| pnpm publish --no-git-checks |
There was a problem hiding this comment.
The pnpm publish command uses both an authentication token set via pnpm config set on line 51 and the NODE_AUTH_TOKEN environment variable on line 54. The NODE_AUTH_TOKEN environment variable is the standard way for pnpm to authenticate, but the config set command may conflict with it. Consider using only the environment variable approach for clarity. Additionally, when publishing to GitHub Packages, the registry URL should include the scope: //npm.pkg.github.com/@logkat/:_authToken to match the package name @logkat/broker-parser.
| run: | | |
| pnpm config set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }} | |
| pnpm publish --no-git-checks | |
| run: pnpm publish --no-git-checks --registry=https://npm.pkg.github.com |
|
|
||
| # Get versions | ||
| CURRENT_VERSION=$(node -p "require('./package.json').version") | ||
| OLD_VERSION=$(git show main:package.json | node -p "JSON.parse(require('fs').readFileSync(0, 'utf-8')).version") |
There was a problem hiding this comment.
The version comparison logic has a potential issue. The command git show main:package.json | node -p "JSON.parse(require('fs').readFileSync(0, 'utf-8')).version" is attempting to read from stdin (file descriptor 0), but the JSON string is already piped in. The correct approach is to directly parse stdin without using require('fs').readFileSync. Consider changing to: git show main:package.json | node -p "JSON.parse(require('fs').readFileSync('/dev/stdin', 'utf-8')).version" or using a simpler approach like git show main:package.json | node -pe "JSON.parse(require('fs').readFileSync(0)).version".
| OLD_VERSION=$(git show main:package.json | node -p "JSON.parse(require('fs').readFileSync(0, 'utf-8')).version") | |
| OLD_VERSION=$(git show main:package.json | node -pe "JSON.parse(require('fs').readFileSync(0)).version") |
| NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| NPM_CONFIG_REGISTRY: https://npm.pkg.github.com/ | ||
| run: npx semantic-release | ||
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
The release workflow doesn't create a GitHub release or tag when publishing the package. Consider adding a step to create a GitHub release using the gh release create command or an action like actions/create-release to track releases properly and provide release notes to users.
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Git tag and GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| TAG="v$VERSION" | |
| if git rev-parse "$TAG" >/dev/null 2>&1; then | |
| echo "Tag $TAG already exists, skipping tag and release creation." | |
| exit 0 | |
| fi | |
| git tag "$TAG" | |
| git push origin "$TAG" | |
| gh release create "$TAG" --generate-notes |
No description provided.