Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e61f10c
added Jenkins file
ishaan1607 Apr 22, 2025
b8e2732
changes in Jenkinfiles
ishaan1607 Apr 22, 2025
e73a847
changes in Jenkinfiles
ishaan1607 Apr 22, 2025
e27b645
changes in Jenkinfiles
ishaan1607 Apr 22, 2025
c0e6f31
changes in Jenkinfiles
ishaan1607 Apr 22, 2025
601ff38
changes in Jenkinfiles after git 404
ishaan1607 Apr 22, 2025
e983a1f
version update
ishaan1607 Apr 22, 2025
94abebc
changes in Jenkinfiles after git 404
ishaan1607 Apr 22, 2025
5a5f5ed
chore: updated creds as per prod jenkins
ishaan1607 Apr 23, 2025
e473ba4
chore: updated creds as per prod jenkins
ishaan1607 Apr 23, 2025
56caf69
chore: updated creds as per prod jenkins
ishaan1607 Apr 23, 2025
30cbb21
chore: updated creds as per prod jenkins
ishaan1607 Apr 23, 2025
b0966b3
chore: updated creds as per prod jenkins
ishaan1607 Apr 23, 2025
f9c9726
chore: updated jenkinsfile as per node error
ishaan1607 Apr 23, 2025
96a912e
chore: updated jenkinsfile as per git error
ishaan1607 Apr 23, 2025
4ea8a7f
chore: updated jenkinsfile as per git error
ishaan1607 Apr 23, 2025
95b9ea2
chore: updated jenkinsfile as per git token error
ishaan1607 Apr 23, 2025
e8b249c
chore: updated jenkinsfile as per slack error
ishaan1607 Apr 23, 2025
bb97e1e
chore: updated jenkinsfile as per slack error
ishaan1607 Apr 23, 2025
eabbdb4
chore: updated jenkinsfile as per toLong error
ishaan1607 Apr 23, 2025
8a79ad2
chore: formatting done
ishaan1607 Apr 23, 2025
8675de0
chore: version increase
ishaan1607 Apr 23, 2025
bff871c
chore: git token error fixed
ishaan1607 Apr 23, 2025
d62c647
chore: git token error fixed
ishaan1607 Apr 23, 2025
055dad3
chore: git token error fixed 2
ishaan1607 Apr 23, 2025
8e5dbb7
chore: git token error fixed 2
ishaan1607 Apr 23, 2025
805721e
chore: added pr template
ishaan1607 Apr 23, 2025
2bbd741
chore: added pr template
ishaan1607 Apr 23, 2025
a3b9878
chore: versions corrected and increased
ishaan1607 Apr 23, 2025
e69dbb5
chore: added branch name check
ishaan1607 Apr 23, 2025
a95a5ff
Merge pull request #135 from LikeMindsCommunity/feature/LM-13590_crea…
ishaan1607 Apr 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
21 changes: 21 additions & 0 deletions .github/workflows/branch-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Valid Source Branches

on:
pull_request:
branches:
- master

jobs:
validate-source-branch:
name: Validate Source Branch Pattern
runs-on: ubuntu-latest
steps:
- name: Check if source branch is allowed
run: |
echo "🔍 Checking branch: ${{ github.head_ref }}"
if [[ ! "${{ github.head_ref }}" =~ ^release/v[0-9]+\.[0-9]+\.[0-9]+$ && ! "${{ github.head_ref }}" =~ ^hotfix/LM-[0-9]+_[a-zA-Z0-9_-]+$ ]]; then
echo "🚫 Only branches matching 'release/vX.Y.Z' or 'hotfix/LM-12345_description' can be merged into master."
exit 1
else
echo "✅ Valid source branch: ${{ github.head_ref }}"
fi
Empty file added .npmrc
Empty file.
160 changes: 160 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
pipeline {
agent any

environment {
NODE_ENV = 'development' // Don’t set to production to allow dev deps
NPM_TOKEN = credentials('ISHAAN_NPM_TOKEN')
SLACK_WEBHOOK = credentials('SLACK_JS_CHANNEL_URL')
REPO = 'LikeMindsCommunity/likeminds-feed-reactjs'
}

tools {
nodejs 'nodejs'
}

stages {
stage('Checkout') {
steps {
checkout scm
}
}

stage('Check git tags') {
steps {
dir('core') {
script {
sh 'git fetch --tags'

def previousVersion = sh(
script: 'git describe --tags --abbrev=0',
returnStdout: true
).trim()

def currentVersion = sh(
script: "node -p \"require('./package.json').version\"",
returnStdout: true
).trim()

echo "Previous version: ${previousVersion}, Current version: v${currentVersion}"

if (previousVersion != "v${currentVersion}") {
echo "Version has changed from ${previousVersion} to v${currentVersion}."
} else {
echo 'Version has not changed.'
error "Stopping the pipeline as the version hasn't changed."
}
}
}
}
}

stage('Install & Build SDK') {
steps {
dir('core') {
sh 'npm install --legacy-peer-deps'
sh 'npm run build-lib'
}
}
}

stage('Publish to npm') {
steps {
dir('core') {
sh '''
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm publish
'''
}
}
}

stage('Tag & GitHub Release') {
steps {
dir('core') {
script {
def version = sh(script: "node -p \"require('./package.json').version\"", returnStdout: true).trim()
def tagName = "v${version}"
def releaseName = "Release ${version}"

sh '''
git config user.name 'Ishaan Jain'
git config user.email 'ishaan.jain@likeminds.community'
'''

sh "git tag ${tagName}"

withCredentials([string(credentialsId: 'ISHAAN_GITHUB_TOKEN', variable: 'GITHUB_TOKEN')]) {
writeFile file: 'release_payload.json', text: """
{
"tag_name": "${tagName}",
"name": "${releaseName}",
"generate_release_notes": true,
"draft": false,
"prerelease": false
}
"""

// push the tag securely & safely
sh """
git remote set-url origin https://\$GITHUB_TOKEN@github.com/${REPO}.git
git push origin refs/tags/${tagName}
"""

// create the GitHub release
sh '''
curl -X POST https://api.github.com/repos/LikeMindsCommunity/likeminds-feed-reactjs/releases \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-d @release_payload.json
'''
}

currentBuild.description = tagName
}
}
}
}

stage('Notify Slack') {
steps {
withCredentials([string(credentialsId: 'SLACK_JS_CHANNEL_URL', variable: 'SLACK_WEBHOOK')]) {
script {
def version = sh(script: "node -p \"require('./core/package.json').version\"", returnStdout: true).trim()
def branch = env.GIT_BRANCH ?: 'unknown'
def buildNumber = env.BUILD_NUMBER
def jobName = env.JOB_NAME
def timestamp = (System.currentTimeMillis() / 1000)

def slackPayload = """
{
"attachments": [
{
"color": "#36a64f",
"title": "✅ ReactJS SDK Deployed",
"title_link": "https://github.com/${REPO}/releases/tag/${version}",
"text": "A new version of the React SDK has been deployed and released.",
"fields": [
{ "title": "Version", "value": "${version}", "short": true },
{ "title": "Branch", "value": "${branch}", "short": true },
{ "title": "Build", "value": "#${buildNumber}", "short": true },
{ "title": "Job Name", "value": "${jobName}", "short": true }
],
"footer": "Jenkins CI",
"footer_icon": "https://jenkins.io/images/logos/jenkins/jenkins.png",
"ts": ${timestamp}
}
]
}
"""
writeFile file: 'slack_payload.json', text: slackPayload

sh '''
curl -X POST -H "Content-Type: application/json" \
--data @slack_payload.json $SLACK_WEBHOOK
'''
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@likeminds.community/likeminds-feed-reactjs",
"version": "1.10.0",
"version": "1.11.0",
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
Expand Down
2 changes: 1 addition & 1 deletion core/src/shared/getClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { LMFeedClient } from "@likeminds.community/feed-js";
export function initiateFeedClient() {
const lmFeedClient = LMFeedClient.Builder()
.setPlatformCode("rt")
.setVersionCode(21)
.setVersionCode(22)
.build();
return lmFeedClient;
}
40 changes: 0 additions & 40 deletions core/vite.config.js.timestamp-1730223298821-ceb3232dc5a83.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion qna-feed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@likeminds.community/likeminds-feed-reactjs": "^1.8.1",
"@likeminds.community/likeminds-feed-reactjs": "^1.11.0",
"@mui/icons-material": "^6.0.2",
"@mui/material": "^6.0.2",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion social-feed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^7.3.0",
"@likeminds.community/likeminds-feed-reactjs": "1.10.0"
"@likeminds.community/likeminds-feed-reactjs": "1.11.0"
},
"devDependencies": {
"@types/react": "^18.0.0",
Expand Down