-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41069e4
commit 605c156
Showing
4 changed files
with
121 additions
and
97 deletions.
There are no files selected for viewing
This file contains 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,49 @@ | ||
name: Publish to NPM | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Configure Git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Bump version | ||
if: github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip ci]') | ||
run: | | ||
npm version patch -m "Bump version to %s [skip ci]" | ||
git push | ||
git push --tags | ||
- name: Build | ||
run: npm run build | ||
|
||
- name: Publish to NPM | ||
if: success() | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains 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 |
---|---|---|
@@ -1,31 +1,11 @@ | ||
# Source | ||
# Source files (since we publish the build) | ||
src/ | ||
|
||
# Development configs | ||
# Development files | ||
.github/ | ||
tsconfig.json | ||
.gitignore | ||
.env* | ||
.vscode/ | ||
|
||
# Logs | ||
*.log | ||
server.log | ||
|
||
# Tests | ||
test/ | ||
__tests__/ | ||
*.test.ts | ||
*.spec.ts | ||
|
||
# Development files | ||
.editorconfig | ||
.eslintrc* | ||
.prettierrc* | ||
.github/ | ||
docs/ | ||
|
||
# Dependencies | ||
node_modules/ | ||
|
||
# Don't ignore | ||
# Don't ignore the build directory | ||
!build/ |
This file contains 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 contains 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