Skip to content

Commit

Permalink
ci: add more automation
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 authored Feb 26, 2024
1 parent 480f853 commit b7d5e76
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/alpha-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Publish and deploy alpha versions

on:
push:
branches:
- publish-alpha

jobs:
bump_versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git user
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- name: Install packages
run: yarn install --frozen-lockfile

- name: Update versions
env:
BUMP: ${{ github.event.inputs.versionBump }}
run: |
yarn global add lerna@5
lerna -v
echo $(lerna version $BUMP --no-git-tag-version --exact --yes --no-private)
lerna add @100mslive/hms-video-store --peer --scope=@100mslive/hms-virtual-background --exact
lerna add @100mslive/roomkit-react --scope=prebuilt-react-integration --exact
- name: Commit and push changes
run: |
git add .
git commit -m "build: update versions for release"
git push origin HEAD:publish-alpha
publish_packages:
runs-on: ubuntu-latest
needs: bump_versions
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/

- name: Install packages
run: yarn install

- name: Test
run: yarn test

- name: Configure Git user
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
# from-package will publish whatever version is present in each package's package.json
# it will not publish if the version is already published in npm
- name: Publish
run: yarn lerna:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
PUBLISH_FLAG: alpha

# Delay to wait for the publish to finish
- name: Delay for 2 minutes
run: sleep 120

- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PAT }}
repository: 100mslive/100ms-links
event-type: alpha-publish

22 changes: 22 additions & 0 deletions .github/workflows/sync-alpha-to-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Update publish-alpha
on:
pull_request:
types: [closed]
branches:
- main

jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: pull-request
uses: repo-sync/pull-request@v2
if: github.event.pull_request.merged == true
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: 'main'
destination_branch: 'publish-alpha'
pr_title: 'Update publish-alpha'
pr_body: ':robot: Automated PR from main to publish-alpha'
pr_label: 'auto-pr'

0 comments on commit b7d5e76

Please sign in to comment.