Skip to content

Commit

Permalink
automating npm registry release
Browse files Browse the repository at this point in the history
  • Loading branch information
KnockOutEZ committed Feb 28, 2024
1 parent ae3925b commit a212fdd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/releaser.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
name: Release
name: Release and Publish

on:
push:
branches:
- main

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/[email protected]
id: release

- name: Print release output
if: ${{ steps.release.outputs.released == 'true' }}
run: echo Release ID ${{ steps.release.outputs.release_id }}
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' }}
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)

___

Expand All @@ -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)

0 comments on commit a212fdd

Please sign in to comment.