-
Notifications
You must be signed in to change notification settings - Fork 17
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
25b4c8a
commit 1e79fe5
Showing
3 changed files
with
63 additions
and
103 deletions.
There are no files selected for viewing
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,49 +1,69 @@ | ||
name: npm publish | ||
name: publish | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Target version' | ||
description: 'version' | ||
required: true | ||
push: | ||
branches: | ||
- 'feat/AC-1856' | ||
type: string | ||
npm_tag: | ||
description: 'release tag' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Check if branch exists | ||
id: check-branch | ||
run: | | ||
if git ls-remote --heads origin release/v${{ github.event.inputs.version }} | grep -q refs/heads/release/v${{ github.event.inputs.version }}; then | ||
echo "Branch exists." | ||
else | ||
echo "Branch does not exist." | ||
exit 1 | ||
fi | ||
- uses: actions/setup-node@v3 | ||
- name: Install and Build 🔧 | ||
with: | ||
node-version: 16.x | ||
- name: Install and Build | ||
run: | | ||
npm install | ||
npm version ${{ github.event.inputs.version }} | ||
touch .env.production | ||
echo "VITE_CHAT_AI_WIDGET_KEY=${{ secrets.chat_ai_widget_key }}" >> .env.production | ||
npm run build:npm | ||
- name: 'set environments' | ||
- name: Publish to npm | ||
run: | | ||
if [ -z "${{ github.event.inputs.npm_tag }}" ]; then | ||
npm publish --access=public | ||
else | ||
npm publish --tag ${{ github.event.inputs.npm_tag }} --access=public | ||
fi | ||
- name: Set environments | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.npm_token }}" >> .npmrc | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "sendbird-sdk-deployment" | ||
- name: 'build and publish to npm' | ||
git config --global user.email "[email protected]" | ||
echo "RELEASE_DATE=$(date +'%b %d %Y')" >> $GITHUB_ENV | ||
echo "LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV | ||
- name: Generate CHANEGLOG | ||
run: | | ||
npm publish -access=public | ||
- name: 'create a pull request' | ||
echo "## [$LATEST_TAG] - $RELEASE_DATE" > temp-changelog.md | ||
git log $LATEST_TAG..develop --oneline >> temp-changelog.md | ||
echo "" >> temp-changelog.md | ||
cat CHANGELOG.md >> temp-changelog.md | ||
mv temp-changelog.md CHANGELOG.md | ||
git commit -m "Update CHANGELOG.md for $LATEST_TAG" | ||
git push origin v${{ github.event.inputs.version }} | ||
- name: Update installed chat-ai-widget version to latest under packages/* | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh pr create --title "chore(release): publish ${{ github.event.inputs.version }}" --body "created by automation" | ||
packages=( "url-webdemo" "self-service" ) | ||
for package in "${packages[@]}"; do | ||
cd ./packages/$package | ||
npm install @sendbird/chat-ai-widget@${{ github.event.inputs.version }} | ||
cd - | ||
done | ||
git add . | ||
git commit -m "chore: update chat-ai-widget version to v${{ github.event.inputs.version }}" | ||
git push origin release/v${{ github.event.inputs.version }} | ||
- name: Tag new target and push to origin | ||
run: | | ||
git tag v${{ github.event.inputs.version }} | ||
git push origin v${{ github.event.inputs.version }} |
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,19 @@ | ||
name: PR comment bot | ||
on: | ||
issue_comment: | ||
types: [created] | ||
jobs: | ||
pr-comment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# see list of commands: https://github.com/sendbird/release-automation-action#commands | ||
- uses: sendbird/release-automation-action@latest | ||
with: | ||
gh_token: ${{ secrets.GITHUB_TOKEN }} | ||
circleci_token: ${{ secrets.CIRCLECI_API_TOKEN }} | ||
product: 'chat-ai-widget' | ||
platform: 'js' | ||
framework: 'react' | ||
product_jira_project_key: 'AC' | ||
product_jira_version_prefix: 'js_chat_ai_widget' |
This file was deleted.
Oops, something went wrong.