diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b6c998d..c0ea675 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,17 +5,18 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + packages: write + contents: read steps: - uses: actions/checkout@v3 - # Setup .npmrc file to publish to npm - uses: actions/setup-node@v3 with: node-version: '18.x' registry-url: 'https://npm.pkg.github.com' # Defaults to the user or organization that owns the workflow file scope: '@dsaidgovsg' - - run: npm install - - run: npm run build + - run: npm ci - run: npx changeset publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.npmrc b/.npmrc index 4f84993..809cb67 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,3 @@ auto-install-peers = true always-auth = true +@dsaidgovsg:registry=https://npm.pkg.github.com diff --git a/package-lock.json b/package-lock.json index bea521c..2f47f5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13338,6 +13338,7 @@ } }, "packages/chain-wrap-components": { + "name": "@dsaidgovsg/chain-wrap-components", "version": "0.0.3", "license": "MIT", "dependencies": { @@ -13399,6 +13400,7 @@ } }, "packages/swagger-ui-custom-layout": { + "name": "@dsaidgovsg/swagger-ui-custom-layout", "version": "0.0.3", "license": "MIT", "devDependencies": { @@ -13425,6 +13427,7 @@ } }, "packages/swagger-ui-plugin-otp-auth": { + "name": "@dsaidgovsg/swagger-ui-plugin-otp-auth", "version": "0.0.3", "license": "MIT", "devDependencies": { @@ -13451,6 +13454,7 @@ } }, "packages/swagger-ui-plugin-saml-auth": { + "name": "@dsaidgovsg/swagger-ui-plugin-saml-auth", "version": "0.0.3", "license": "MIT", "devDependencies": { diff --git a/package.json b/package.json index 7beee37..e575d41 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "lint": "turbo run lint", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "test": "turbo run test", - "test:watch": "turbo run test:watch" + "test:watch": "turbo run test:watch", + "prepare": "npm run build" }, "devDependencies": { "@babel/core": "^7.21.5", diff --git a/packages/chain-wrap-components/package.json b/packages/chain-wrap-components/package.json index 2cb5dee..02ad42b 100644 --- a/packages/chain-wrap-components/package.json +++ b/packages/chain-wrap-components/package.json @@ -8,12 +8,16 @@ "files": [ "dist" ], + "publishConfig": { + "@dsaidgovsg:registry": "https://npm.pkg.github.com" + }, "scripts": { "build": "tsup ./index.jsx --format iife,cjs,esm --replaceNodeEnv", "lint": "eslint \"**/*.@(js|jsx)\"", "dev": "npm run build -- --watch", "test": "jest --coverage", - "test:watch": "jest --watch" + "test:watch": "jest --watch", + "prepare": "npm run build" }, "dependencies": { "deepmerge": "4.3.1" diff --git a/packages/swagger-ui-custom-layout/package.json b/packages/swagger-ui-custom-layout/package.json index dad05be..e40c2e5 100644 --- a/packages/swagger-ui-custom-layout/package.json +++ b/packages/swagger-ui-custom-layout/package.json @@ -8,10 +8,14 @@ "files": [ "dist" ], + "publishConfig": { + "@dsaidgovsg:registry": "https://npm.pkg.github.com" + }, "scripts": { "build": "tsup ./index.js --format iife,cjs,esm --replaceNodeEnv", "lint": "eslint \"**/*.@(js|jsx)\"", - "dev": "npm run build -- --watch" + "dev": "npm run build -- --watch", + "prepare": "npm run build" }, "peerDependencies": { "react": "18.2.0", diff --git a/packages/swagger-ui-plugin-otp-auth/package.json b/packages/swagger-ui-plugin-otp-auth/package.json index 1ed7082..7425325 100644 --- a/packages/swagger-ui-plugin-otp-auth/package.json +++ b/packages/swagger-ui-plugin-otp-auth/package.json @@ -8,12 +8,16 @@ "files": [ "dist" ], + "publishConfig": { + "@dsaidgovsg:registry": "https://npm.pkg.github.com" + }, "scripts": { "build": "tsup ./index.jsx --format iife,cjs,esm --replaceNodeEnv", "lint": "eslint \"**/*.@(js|jsx)\"", "dev": "npm run build -- --watch", "test": "jest --coverage", - "test:watch": "jest --watch" + "test:watch": "jest --watch", + "prepare": "npm run build" }, "peerDependencies": { "react": "18.2.0", diff --git a/packages/swagger-ui-plugin-saml-auth/package.json b/packages/swagger-ui-plugin-saml-auth/package.json index 205198d..cf4bb22 100644 --- a/packages/swagger-ui-plugin-saml-auth/package.json +++ b/packages/swagger-ui-plugin-saml-auth/package.json @@ -8,12 +8,16 @@ "files": [ "dist" ], + "publishConfig": { + "@dsaidgovsg:registry": "https://npm.pkg.github.com" + }, "scripts": { "build": "tsup ./index.js --format iife,cjs,esm --replaceNodeEnv", "lint": "eslint \"**/*.@(js|jsx)\"", "dev": "npm run build -- --watch", "test": "jest --coverage", - "test:watch": "jest --watch" + "test:watch": "jest --watch", + "prepare": "npm run build" }, "peerDependencies": { "react": "18.2.0",