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
74 changes: 74 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Publish Package
on:
release:
types: [published]

jobs:
prepare:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.repository.default_branch }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run tests
run: npm test
- name: Update package.json with release tag
run: |
TAG="${{ github.event.release.tag_name }}"
echo "Updating package.json version to $TAG"
npm version "$TAG" --no-git-tag-version
- name: Commit and push version update
run: |
TAG="${{ github.event.release.tag_name }}"
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add package.json package-lock.json
git commit -m "Update package.json to version $TAG"
git push origin ${{ github.event.repository.default_branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-npm:
needs: prepare
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org

- run: npm ci
- run: npm run release

publish-github:
needs: prepare
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: 'https://npm.pkg.github.com'
- run: npm ci
- run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# simple-async-pool
[![ci:build](https://flat.badgen.net/github/checks/notanengineercom/simple-async-pool/main/build?label=build&icon=github)](https://github.com/notanengineercom/simple-async-pool/actions)
[![ci:test](https://flat.badgen.net/github/checks/notanengineercom/simple-async-pool/main/test?label=test&icon=github)](https://github.com/notanengineercom/simple-async-pool/actions)
[![npm:version](https://flat.badgen.net/npm/license/simple-async-pool?icon=npm)](https://www.npmjs.com/package/simple-async-pool)
[![npm:version](https://flat.badgen.net/npm/v/simple-async-pool?icon=npm)](https://www.npmjs.com/package/simple-async-pool)
[![packagephobia](https://flat.badgen.net/packagephobia/install/simple-async-pool)](https://packagephobia.com/result?p=simple-async-pool)
[![lgtm](https://flat.badgen.net/lgtm/grade/g/notanengineercom/simple-async-pool)](https://lgtm.com/projects/g/notanengineercom/simple-async-pool)
[![ci](https://flat.badgen.net/github/checks/notanengineercom/simple-async-pool/main?icon=github)](https://github.com/notanengineercom/simple-async-pool/actions)

Easy to use, dependency free and typesafe concurrent pool of async and promise returning functions.

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
},
"scripts": {
"test": "mocha --require tsx 'tests/**/*.ts'",
"lint": "oxlint 'src/**/*.ts' 'tests/**/*.ts'",
"build": "tsl -p tsconfig.build.json",
"lint": "oxlint 'src/**/*.ts' 'tests/**/*.ts' && tsl -p tsconfig.json",
"build": "tsc -p tsconfig.build.json",
"release": "npm run build && cp package.json dist && cp README.md dist && npm publish ./dist",
"prepare": "husky"
},
Expand Down