-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.1 KB
/
release-ghr.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
47
48
name: Release to GHR
on:
push:
branches:
- staging
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://npm.pkg.github.com
scope: "@dyte-in"
- name: Set NPM_TOKEN
run: echo "NPM_TOKEN=${{ secrets.NPM_TOKEN }}" >> $GITHUB_ENV
- name: Install dependencies
run: npm install
- name: Build package
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENVIRONMENT: ${{ github.ref }}
GHR: true
run: npx semantic-release
- name: Update staging branch
if: |
contains('refs/heads/main', github.ref)
run: |
git pull
git stash
git checkout staging
git merge main
git push --set-upstream origin staging