-
Notifications
You must be signed in to change notification settings - Fork 11
Update Github Workflow #327
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d6bc889
Update Github workflow
daweifeng-replit dcb2774
Update README and workflow for automated release
daweifeng-replit f661650
...
daweifeng-replit 415d72f
Update README.md
daweifeng-replit 438cd69
format
daweifeng-replit 887cdd6
Use node 22 in ci
daweifeng-replit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Prepare Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| tag-release: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: read | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| # Run release-drafter to determine the next version | ||
| - name: Determine next version from release-drafter | ||
| id: release_drafter | ||
| uses: release-drafter/release-drafter@v6 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| # Use the output from the previous step to version the package | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config user.name 'GitHub Actions' | ||
| git config user.email 'eng+github@repl.it' | ||
|
|
||
| - name: Bump version and create tag | ||
| run: | | ||
| # Get the tag_name output from the release-drafter step | ||
| tag="${{ steps.release_drafter.outputs.tag_name }}" | ||
|
|
||
| # Strip the 'v' prefix to get the bare version number | ||
| version="${tag#v}" | ||
|
|
||
| echo "Next version calculated by release-drafter is: $version" | ||
|
|
||
| # Use the calculated version with npm version | ||
| npm version "$version" | ||
|
|
||
| - name: Push changes and tags | ||
| run: git push --follow-tags | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # .github/workflows/publish.yml | ||
| name: Build and Publish Package | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' # Trigger on tags like v1.0.0, v2.3.4, etc. | ||
|
|
||
| jobs: | ||
| build-and-publish: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| # This checks out the code at the specific tag that triggered the workflow | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| registry-url: 'https://registry.npmjs.org/' | ||
|
|
||
| - name: Install dependencies and build | ||
| run: npm ci | ||
|
|
||
| - name: Publish to npm | ||
| run: npm publish --access public | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPMJS_AUTH_TOKEN }} | ||
|
|
||
| - name: Publish GitHub Release | ||
| uses: release-drafter/release-drafter@v5 | ||
| with: | ||
| publish: true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.