Skip to content

Commit

Permalink
Merge pull request #7 from michael-freling/release/dev
Browse files Browse the repository at this point in the history
ci: build extensions for QA before publishing to a browser store
  • Loading branch information
michael-freling authored Jul 12, 2024
2 parents a7380c9 + bdff008 commit ef26507
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
File renamed without changes.
32 changes: 21 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: production
strategy:
matrix:
browser: [chrome, edge]
env: [staging, production]
environment: ${{ matrix.env }}
steps:
- uses: actions/checkout@v4

Expand All @@ -29,13 +30,25 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: "Create .env.dev file"
if: ${{ matrix.env == 'staging' }}
run: |
rm .env.*
touch .env.staging
echo "# GitHub actions secrets: https://github.com/michael-freling/chrome-extension-anime-spoiler-blocker/settings/environments/3359267164/edit" >> .env.staging
echo "PLASMO_PUBLIC_EXTENSION_ID=$PLASMO_PUBLIC_EXTENSION_ID" >> .env.staging
echo "CRX_PUBLIC_KEY=$CRX_PUBLIC_KEY" >> .env.staging
env:
PLASMO_PUBLIC_EXTENSION_ID: ${{ vars.PLASMO_PUBLIC_EXTENSION_ID }}
CRX_PUBLIC_KEY: ${{ secrets.CRX_PUBLIC_KEY }}

- name: Build
run: pnpm plasmo build --target=${{ matrix.browser }}-mv3 --zip
run: pnpm plasmo build --tag=${{ matrix.env }} --target=${{ matrix.browser }}-mv3 --zip

- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.browser }}
path: build/${{ matrix.browser }}-mv3-prod.zip
name: extension-${{ matrix.browser }}-${{ matrix.env }}
path: build/${{ matrix.browser }}-mv3-${{ matrix.env }}.zip

publish:
runs-on: ubuntu-latest
Expand All @@ -46,12 +59,9 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: chrome
path: build
- uses: actions/download-artifact@v4
with:
name: edge
pattern: extension-*
path: build
merge-multiple: true

- run: ls -lRa build

Expand All @@ -60,7 +70,7 @@ jobs:
# https://earthly.dev/blog/github-action-artifacts/
- uses: ncipollo/release-action@v1
with:
artifacts: "build/chrome-mv3-prod.zip,build/edge-mv3-prod.zip"
artifacts: "build/*.zip"
# Following fields are for debugging
# allowUpdates: true
# tag: "v0.1.1"
Expand All @@ -71,6 +81,6 @@ jobs:
# uses: PlasmoHQ/bpp@v3
# with:
# keys: ${{ secrets.BPP_KEYS }}
# chrome-file: "build/chrome-mv3-prod.zip"
# chrome-file: "build/chrome-mv3-production.zip"
# # version-file: "src/manifest.json"
# verbose: true
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ There are a few features supported to block spoilers

Currently, spoilers are blocked on YouTube only.
Currently, [Crunchyroll](https://www.crunchyroll.com/) is the only supported service to store a watch history on your chrome browser.


## Development

There are 2 versions of published extensions
- production: Extensions to publish from web stores of each browser like Chrome. This release cannot be installed from the GitHub release page.
- staging: Extensions that can be installed from the GitHub release page and run them.

0 comments on commit ef26507

Please sign in to comment.