This repository has been archived by the owner on Aug 16, 2023. It is now read-only.
Publish #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- src/** | |
workflow_dispatch: ~ | |
env: | |
PATH_EXTENSION_ZIP: out/the-content-farm-terminator.zip | |
jobs: | |
build-chrome: | |
name: Build project for Google Chrome and Microsoft Edge | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js v18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
run_install: true | |
- name: Build project | |
run: pnpm build:chrome | |
- name: Save extension zip | |
uses: actions/upload-artifact@v3 | |
with: | |
name: the-content-farm-terminator_chrome.zip | |
path: ${{ env.PATH_EXTENSION_ZIP }} | |
build-firefox: | |
name: Build project for Mozilla Firefox | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js v18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
run_install: true | |
- name: Build project | |
run: pnpm build:firefox | |
- name: Save addon xpi | |
uses: actions/upload-artifact@v3 | |
with: | |
name: the-content-farm-terminator_firefox.zip | |
path: ${{ env.PATH_EXTENSION_ZIP }} | |
publish-chrome: | |
name: Publish extension to Chrome Web Store | |
runs-on: ubuntu-latest | |
needs: | |
- build-chrome | |
env: | |
EXTENSION_ID: chhekpgdckchblnfdelceaigmlfbakgn | |
steps: | |
- name: Download extension zip | |
uses: actions/download-artifact@v3 | |
with: | |
name: the-content-farm-terminator_chrome.zip | |
path: . | |
- name: Publish to Chrome Web Store | |
uses: wdzeng/chrome-extension@v1 | |
with: | |
extension-id: ${{ env.EXTENSION_ID }} | |
zip-path: the-content-farm-terminator.zip | |
client-id: ${{ secrets.CHROME_API_CLIENT_ID }} | |
client-secret: ${{ secrets.CHROME_API_CLIENT_SECRET }} | |
refresh-token: ${{ secrets.CHROME_API_REFRESH_TOKEN }} | |
publish-edge: | |
name: Publish extension to Edge Add-ons | |
runs-on: ubuntu-latest | |
needs: | |
- build-chrome | |
steps: | |
- name: Download addon zip | |
uses: actions/download-artifact@v3 | |
with: | |
name: the-content-farm-terminator_chrome.zip | |
path: . | |
- name: Publish to Edge Add-ons | |
uses: wdzeng/edge-addon@v1 | |
with: | |
product-id: ${{ secrets.EDGE_PRODUCT_ID }} | |
zip-path: the-content-farm-terminator.zip | |
client-id: ${{ secrets.EDGE_API_CLIENT_ID }} | |
client-secret: ${{ secrets.EDGE_API_CLIENT_SECRET }} | |
access-token-url: ${{ secrets.EDGE_API_ACCESS_TOKEN_URL }} | |
publish-firefox: | |
name: Publish extension to Firefox Addons | |
runs-on: ubuntu-latest | |
needs: | |
- build-firefox | |
steps: | |
- name: Download addon xpi | |
uses: actions/download-artifact@v3 | |
with: | |
name: the-content-farm-terminator_firefox.zip | |
path: . | |
- name: Publish to Firefox Addons | |
uses: wdzeng/firefox-addon@v1 | |
with: | |
xpi-path: the-content-farm-terminator.zip | |
addon-guid: ${{ secrets.FIREFOX_ADDON_GUID }} | |
jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }} | |
jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }} | |