From 78e656e7cec13486ff3687b7ba42bbf94f9d2693 Mon Sep 17 00:00:00 2001 From: Jaepil Kim Date: Tue, 17 Oct 2023 22:02:30 +1100 Subject: [PATCH] fix: CSS-235 Some fix and deployment process - Added CHANGELOG - Fixed package name - Added github workflow --- .github/workflows/publish-npm.yml | 77 +++++++++++++++++++++++++++++++ CHANGELOG.md | 14 ++++++ package.json | 5 +- 3 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-npm.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..aec85cf --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,77 @@ +name: publish-npm +on: + workflow_dispatch: + + push: + paths: + - '**' + - .github/workflows/publish-npm.yml + branches: + - 'master' + pull_request: + paths: + - '**' + - .github/workflows/publish-npm.yml + branches: + - 'master' + +defaults: + run: + working-directory: . + +jobs: + validate-npm: + if: github.event_name == 'pull_request' + runs-on: self-hosted + container: acloudgurudevs/acg:16.13.2-alpine + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} # organization secret + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # organization secret + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Mark git checkout as safe + run: git config --global --add safe.directory $GITHUB_WORKSPACE + + - uses: actions/setup-node@v3 + with: + node-version-file: .tool-versions + cache: yarn + cache-dependency-path: yarn.lock + + - name: install dependencies + run: | + echo //registry.npmjs.org/:_authToken=$NPM_TOKEN > .npmrc + yarn config set unsafe-perm true + yarn install --frozen-lockfilec + + - name: Validate NPM + run: yarn validate + publish-npm: + if: github.event.ref == 'refs/heads/master' + runs-on: self-hosted + container: acloudgurudevs/acg:16.13.2-alpine + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} # organization secret + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # organization secret + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: master + + - name: Mark git checkout as safe + run: git config --global --add safe.directory $GITHUB_WORKSPACE + + - name: install dependencies + run: | + echo //registry.npmjs.org/:_authToken=$NPM_TOKEN > .npmrc + yarn config set unsafe-perm true + yarn install --frozen-lockfilec + + - name: Publish to NPM + run: npm publish diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2c260b2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog +All notable changes to this project will be documented in this file. + +## [1.4.0] - 2023-10-17 + +### Added +- Added CHANGELOG.md + +### Changed +- Replaced react-scripts with tsup + +### Removed +- Removed babel and its plugins +- Removed unnecessary assets diff --git a/package.json b/package.json index ce455bb..d31acdc 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "react-algolia", + "name": "@a-cloud-guru/react-algolia", "version": "1.4.0", "license": "MIT", "main": "dist/index.js", @@ -14,7 +14,8 @@ "clean": "rm -rf ./dist ./node_modules", "prebuild": "yarn run clean && yarn", "build": "tsup", - "prepublishOnly": "rm -rf ./dist && yarn build" + "prepublishOnly": "rm -rf ./dist && yarn build", + "validate": "echo 'Please add validate step'" }, "browserslist": { "production": [