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 6c2df8b
Show file tree
Hide file tree
Showing 2 changed files with 54 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
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish Workflow

on:
push:
branches:
- main

jobs:
build:
uses: ./.github/actions/build.yml@main
with:
publish: true

publish:
needs: build
runs-on: ubuntu-latest

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

- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16

- 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 6c2df8b

Please sign in to comment.