diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d56e557 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,25 @@ +name: Publish Package + +on: + release: + types: [created] + workflow_dispatch: + +permissions: + contents: read + id-token: write + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + registry-url: 'https://registry.npmjs.org' + + - run: npm ci + - run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index d9aca52..ec9cc6a 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,13 @@ It's like `leftpad`, but it appends the string "been" to the left. ## Installation ```bash -npm install beenpad +npm install @soconnor0919/beenpad ``` ## Usage ```javascript -import { beenpad } from 'beenpad'; +import { beenpad } from '@soconnor0919/beenpad'; // Pad to length 7 console.log(beenpad('foo', 7)); diff --git a/package.json b/package.json index 830b1be..2a68e7e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { - "name": "beenpad", + "name": "@soconnor0919/beenpad", "version": "1.0.0", "description": "", + "repository": "git://github.com/soconnor0919/beenpad.git", "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": {