Skip to content

Commit

Permalink
fix: CSS-235 Some fix and deployment process
Browse files Browse the repository at this point in the history
- Added CHANGELOG
- Fixed package name
- Added github workflow
  • Loading branch information
SilverSting committed Oct 17, 2023
1 parent 59385d8 commit 78e656e
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 2 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react-algolia",
"name": "@a-cloud-guru/react-algolia",
"version": "1.4.0",
"license": "MIT",
"main": "dist/index.js",
Expand All @@ -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": [
Expand Down

0 comments on commit 78e656e

Please sign in to comment.