diff --git a/.github/workflows/releaser.yaml b/.github/workflows/releaser.yaml index 6548057..5c49ffe 100644 --- a/.github/workflows/releaser.yaml +++ b/.github/workflows/releaser.yaml @@ -1,4 +1,5 @@ -name: Release +name: Release and Publish + on: push: branches: @@ -6,16 +7,35 @@ on: jobs: build: - name: Release + name: Release and Publish runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Release uses: justincy/github-action-npm-release@2.0.1 id: release + - name: Print release output if: ${{ steps.release.outputs.released == 'true' }} - run: echo Release ID ${{ steps.release.outputs.release_id }} \ No newline at end of file + run: echo Release ID ${{ steps.release.outputs.release_id }} + + # Publish to npm only if release was successful + - name: Set up Node.js environment (if release successful) + uses: actions/setup-node@v3 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + if: ${{ steps.release.outputs.released == 'true' }} + + - name: Install dependencies (if release successful) + run: npm ci + if: ${{ steps.release.outputs.released == 'true' }} + + - name: Publish to npm (if release successful) + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + if: ${{ steps.release.outputs.released == 'true' }} diff --git a/docs/README.md b/docs/README.md index ee8687f..779b06f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -24,7 +24,7 @@ contain only alphanumeric characters or underscores, and be between 3 and 15 cha #### Defined in -[index.ts:5](https://github.com/pgEdge/prest-client/blob/904bdfc/src/index.ts#L5) +[index.ts:5](https://github.com/pgEdge/prest-client/blob/ae3925b/src/index.ts#L5) ## Functions @@ -48,7 +48,7 @@ Whether the string is a valid username. #### Defined in -[index.ts:12](https://github.com/pgEdge/prest-client/blob/904bdfc/src/index.ts#L12) +[index.ts:12](https://github.com/pgEdge/prest-client/blob/ae3925b/src/index.ts#L12) ___ @@ -72,4 +72,4 @@ The parsed integer value. #### Defined in -[index.ts:22](https://github.com/pgEdge/prest-client/blob/904bdfc/src/index.ts#L22) +[index.ts:22](https://github.com/pgEdge/prest-client/blob/ae3925b/src/index.ts#L22)