-
Notifications
You must be signed in to change notification settings - Fork 10
feat: update release process #35
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build and Test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [24.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache Node.js modules | ||
uses: actions/cache@v3 | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.OS }}-node- | ||
${{ runner.OS }}- | ||
- run: npm install | ||
- run: npm run build --if-present | ||
- run: npm run lint | ||
- run: npm test | ||
env: | ||
CI: true | ||
# - name: Publish to npm | ||
# uses: pascalgn/[email protected] |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,63 @@ | ||||||||||
name: Release | ||||||||||
|
||||||||||
on: | ||||||||||
#push: | ||||||||||
# branches: | ||||||||||
# - main | ||||||||||
|
||||||||||
# Only run if the general build for the main branch has completed | ||||||||||
workflow_run: | ||||||||||
workflows: ["Build and Test"] | ||||||||||
branches: [main] | ||||||||||
types: | ||||||||||
- completed | ||||||||||
|
||||||||||
jobs: | ||||||||||
release: | ||||||||||
name: Release | ||||||||||
runs-on: ubuntu-latest | ||||||||||
outputs: | ||||||||||
version: ${{ steps.version.outputs.test }} | ||||||||||
|
||||||||||
steps: | ||||||||||
- name: Checkout | ||||||||||
uses: actions/checkout@v3 | ||||||||||
with: | ||||||||||
fetch-depth: 0 | ||||||||||
persist-credentials: false | ||||||||||
- name: Setup Node.js | ||||||||||
uses: actions/setup-node@v4 | ||||||||||
with: | ||||||||||
node-version: 24 | ||||||||||
- name: Install dependencies | ||||||||||
run: npm ci | ||||||||||
- name: Install semantic-release extra plugins | ||||||||||
run: npm install --save-dev @semantic-release/changelog @semantic-release/git | ||||||||||
# - name: Lint | ||||||||||
# run: npm run lint-fix | ||||||||||
# - name: Test | ||||||||||
# run: npm run test:unit --if-present | ||||||||||
- name: Build | ||||||||||
run: npm run build | ||||||||||
- name: Release | ||||||||||
id: release | ||||||||||
env: | ||||||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||||||||||
run: | | ||||||||||
npx semantic-release | ||||||||||
echo "version=$(npx semantic-release --version)" >> $GITHUB_OUTPUT | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The command 'npx semantic-release --version' returns the semantic-release tool version, not the released package version. This should capture the actual version released by semantic-release, typically through parsing its output or using a semantic-release plugin that sets the version as an output.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||
- name: GitHub Release update | ||||||||||
uses: softprops/action-gh-release@v1 | ||||||||||
#if: startsWith(github.ref, 'refs/tags/') | ||||||||||
with: | ||||||||||
# body_path: ${{ github.workspace }}-CHANGELOG.txt | ||||||||||
# note you'll typically need to create a personal access token | ||||||||||
# with permissions to create releases in the other repoj | ||||||||||
#token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | ||||||||||
tag_name: ${{ steps.release.outputs.version }} | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This references 'steps.release.outputs.version' but the release step doesn't properly set this output. Since semantic-release typically creates tags automatically, this GitHub Release action may be redundant or should use the tag created by semantic-release.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||
files: | | ||||||||||
LICENSE.md | ||||||||||
README.md | ||||||||||
lib | ||||||||||
package.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output references 'steps.version.outputs.test' but there is no step with id 'version'. The step that generates version output has id 'release', so this should be 'steps.release.outputs.version'.
Copilot uses AI. Check for mistakes.