-
Notifications
You must be signed in to change notification settings - Fork 17
46 lines (45 loc) · 1.53 KB
/
package-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: npm publish
on:
workflow_dispatch:
inputs:
version:
description: 'Target version'
required: true
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 🔧
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'
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'
run: |
npm publish -access=public
- name: 'create a pull request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create --title "chore(release): publish ${{ github.event.inputs.version }}" --body "created by automation"