From 03f6ed3f2f381d39ed1c1d5331ed7b71a1106a77 Mon Sep 17 00:00:00 2001 From: Kethan Vegunta Date: Sat, 20 Jan 2024 11:25:07 -0800 Subject: [PATCH] ci: add publish extension workflow that runs on release publish --- .github/workflows/publish_extension.yaml | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/publish_extension.yaml diff --git a/.github/workflows/publish_extension.yaml b/.github/workflows/publish_extension.yaml new file mode 100644 index 0000000..eb19f59 --- /dev/null +++ b/.github/workflows/publish_extension.yaml @@ -0,0 +1,39 @@ +name: Build & Publish Extension + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the repository to the runner + uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: lts/* + + - name: Install NPM Dependencies and Build Extension + run: | + cd extension + npm ci + npm run tailwind-build + npm run webpack-build-prod + mv dist ../Bias-Buster-Extension + cd ../ + sudo apt-get install -y zip + zip -r Bias-Buster-Extension.zip Bias-Buster-Extension/* + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: Bias-Buster-Extension.zip + + - uses: actions/upload-artifact@v4 + with: + name: Bias-Buster-Extension + path: Bias-Buster-Extension.zip