Skip to content

Commit

Permalink
feat(ci): adding publish workflow to pack extension into a crx file
Browse files Browse the repository at this point in the history
  • Loading branch information
gnugomez committed Dec 1, 2023
1 parent 310b073 commit 30ad45b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Build and Test

on:
push:
branches:
- main
workflow_call: # Will be triggered by the build and publish new version workflow
inputs:
publish:
type: boolean
required: true
description: Whether to publish the artifact
pull_request:
branches:
- main
Expand Down Expand Up @@ -33,4 +36,11 @@ jobs:
run: pnpm lint

- name: Build
run: pnpm build
run: pnpm build

- name: Output artifact
if: ${{ github.event.inputs.publish_artifact == 'true' }}
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Workflow

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Build
uses: ./.github/workflows/build.yml
publish:
needs: build
runs-on: ubuntu-latest

steps:
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: dist
path: dist/

- name: Install npm crx
run: npm install -g crx

- name: Create Extension
run: crx pack dist/

- name: Publish Extension
uses: actions/upload-artifact@v2
with:
name: sync-video-rtc
path: sync-video-rtc.crx

0 comments on commit 30ad45b

Please sign in to comment.