-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c174fb4
commit 30dce3c
Showing
9 changed files
with
2,457 additions
and
210 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,35 @@ | ||
name: Release | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
inputs: | ||
dry_run: | ||
description: Run package release in "dry run" mode (does not publish) | ||
default: false | ||
type: boolean | ||
|
||
jobs: | ||
Release: | ||
name: 🚀 Release | ||
if: github.event.pull_request.merged && startsWith(github.head_ref, 'release-') | ||
package_release: | ||
name: Release From "${{ github.ref_name }}" Branch | ||
runs-on: ubuntu-latest | ||
# GH does not allow to limit branches in the workflow_dispatch settings so this here is a safety measure | ||
if: ${{ inputs.dry_run || startsWith(github.ref_name, 'release') || startsWith(github.ref_name, 'master') }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/github-script@v6 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
script: | | ||
const get_change_log_diff = require('./scripts/get_changelog_diff.js') | ||
core.exportVariable('CHANGELOG', get_change_log_diff()) | ||
// Getting the release version from the PR source branch | ||
// Source branch looks like this: release-1.0.0 | ||
const version = context.payload.pull_request.head.ref.split('-')[1] | ||
core.exportVariable('VERSION', version) | ||
- uses: ./.github/actions/setup-node | ||
|
||
- name: Publish package | ||
run: npm publish | ||
node-version: 22 | ||
- name: Install Dependencies & Build | ||
run: yarn install --frozen-lockfile | ||
- name: Release | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Create release on GitHub | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
body: ${{ env.CHANGELOG }} | ||
tag: ${{ env.VERSION }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
# https://github.com/stream-ci-bot | ||
GH_TOKEN: ${{ secrets.DOCUSAURUS_GH_TOKEN }} | ||
HUSKY: 0 | ||
run: > | ||
yarn semantic-release | ||
${{ inputs.dry_run && '--dry-run' || '' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"branches": [ | ||
{ | ||
"name": "master", | ||
"channel": "latest" | ||
}, | ||
{ | ||
"name": "release-v8", | ||
"channel": "v8", | ||
"range": "8.x" | ||
} | ||
], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "angular", | ||
"releaseRules": [ | ||
{ "type": "chore", "scope": "deps", "release": "patch" }, | ||
{ "type": "refactor", "release": "patch" } | ||
] | ||
} | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "conventionalcommits", | ||
"presetConfig": { | ||
"types": [ | ||
{ | ||
"type": "fix", | ||
"section": "Bug Fixes", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "feat", | ||
"section": "Features", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "chore", | ||
"scope": "deps", | ||
"section": "Chores", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "refactor", | ||
"section": "Refactors", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "perf", | ||
"section": "Performance Improvements", | ||
"hidden": false | ||
} | ||
] | ||
} | ||
} | ||
], | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
"prepareCmd": "NEXT_VERSION=${nextRelease.version} npm run build" | ||
} | ||
], | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "./CHANGELOG.md" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": ["./CHANGELOG.md"] | ||
} | ||
], | ||
"@semantic-release/github", | ||
"@semantic-release/npm" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "stream-chat", | ||
"version": "8.56.1", | ||
"version": "0.0.0-development", | ||
"description": "JS SDK for the Stream Chat API", | ||
"homepage": "https://getstream.io/chat/", | ||
"author": { | ||
|
@@ -61,6 +61,9 @@ | |
"devDependencies": { | ||
"@commitlint/cli": "^16.0.2", | ||
"@commitlint/config-conventional": "^16.0.0", | ||
"@semantic-release/changelog": "^6.0.3", | ||
"@semantic-release/exec": "^7.0.3", | ||
"@semantic-release/git": "^10.0.1", | ||
"@types/base64-js": "^1.3.0", | ||
"@types/chai": "^4.2.15", | ||
"@types/chai-arrays": "^2.0.0", | ||
|
@@ -80,6 +83,7 @@ | |
"chai-like": "^1.1.1", | ||
"chai-sorted": "^0.2.0", | ||
"concurrently": "^9.1.2", | ||
"conventional-changelog-conventionalcommits": "^8.0.0", | ||
"dotenv": "^8.2.0", | ||
"esbuild": "^0.25.0", | ||
"eslint": "7.21.0", | ||
|
@@ -93,6 +97,7 @@ | |
"mocha": "^11.1.0", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.2.1", | ||
"semantic-release": "^24.2.3", | ||
"sinon": "^12.0.1", | ||
"standard-version": "^9.3.2", | ||
"ts-node": "^10.9.2", | ||
|
@@ -102,7 +107,6 @@ | |
}, | ||
"scripts": { | ||
"start": "tsc --watch", | ||
"changelog": "standard-version --release-as $VERSION --skip.tag --skip.commit --tag-prefix=v", | ||
"commitlinter": "commitlint", | ||
"build": "rm -rf dist && yarn bundle", | ||
"bundle": "concurrently 'tsc --declaration --emitDeclarationOnly --outDir ./dist/types' ./scripts/bundle.mjs", | ||
|
@@ -119,13 +123,10 @@ | |
"lint": "yarn run prettier && yarn run eslint", | ||
"lint-fix": "yarn run prettier-fix && yarn run eslint-fix", | ||
"fix-staged": "lint-staged --config .lintstagedrc.fix.json --concurrent 1", | ||
"prepare": "yarn run build", | ||
"preversion": "yarn && yarn lint && yarn test-unit", | ||
"version": "git add yarn.lock", | ||
"postversion": "git push && git push --tags && npm publish" | ||
"semantic-release": "semantic-release" | ||
}, | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"packageManager": "[email protected]+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { execSync } from 'node:child_process'; | ||
import packageJson from '../package.json' with { type: 'json' }; | ||
|
||
// Get the latest version so that magic string __STREAM_CHAT_REACT_VERSION__ can be replaced with it in the source code (used for reporting purposes) | ||
export default function getPackageVersion() { | ||
let version; | ||
// During release, use the version being released | ||
// see .releaserc.json where the `NEXT_VERSION` env variable is set | ||
if (process.env.NEXT_VERSION) { | ||
version = process.env.NEXT_VERSION; | ||
} else { | ||
// Otherwise use the latest git tag | ||
try { | ||
version = execSync('git describe --tags --abbrev=0').toString().trim(); | ||
} catch (error) { | ||
console.error(error); | ||
console.warn('Could not get latest version from git tags, falling back to package.json'); | ||
version = packageJson.version; | ||
} | ||
} | ||
console.log(`Determined the build package version to be ${version}`); | ||
return version; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.