Skip to content

Commit

Permalink
Merge pull request #3 from agoda-com/publish-workflow
Browse files Browse the repository at this point in the history
Create npm-publish.yml
  • Loading branch information
Vedmax committed Feb 19, 2024
2 parents 9ae6d23 + 0075c92 commit 57bba21
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
6 changes: 3 additions & 3 deletions BUILD_TIME.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build Time (Compilation Time)

Requires `@agoda-com/devfeedback` version 1.0.0 or later.
Requires `agoda-devfeedback` version 1.0.0 or later.

## Usage

Expand All @@ -11,7 +11,7 @@ Requires `@agoda-com/devfeedback` version 1.0.0 or later.
If you use **Webpack**, you can add the following to your `webpack.config.js` file:

```javascript
const { WebpackBuildStatsPlugin } = require('@agoda-com/devfeedback');
const { WebpackBuildStatsPlugin } = require('agoda-devfeedback');

module.exports = {
// ...
Expand All @@ -27,7 +27,7 @@ module.exports = {
If you use **Vite** you can add the following to your `vite.config.js` file:

```javascript
import { viteBuildStatsPlugin } from '@agoda-com/devfeedback';
import { viteBuildStatsPlugin } from 'agoda-devfeedback';

export default defineConfig({
// ...
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @agoda-com/devfeedback
# agoda-devfeedback

This is a JavaScript/TypeScript package to collect metrics that relate to developers' experience.

Expand All @@ -7,13 +7,13 @@ This is a JavaScript/TypeScript package to collect metrics that relate to develo
Install the package:

```bash
npm install --save-dev @agoda-com/devfeedback
npm install --save-dev agoda-devfeedback
```

or

```bash
yarn add --dev @agoda-com/devfeedback
yarn add --dev agoda-devfeedback
```

Please note that when an error happens, the package will put the error message to `devfeedback.log` file in the current working directory.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@agoda-com/devfeedback",
"name": "agoda-devfeedback",
"exports": {
"require": "./lib/cjs/index.js",
"import": "./lib/esm/index.js"
Expand Down

0 comments on commit 57bba21

Please sign in to comment.