diff --git a/.env.example b/.env.staging.example similarity index 100% rename from .env.example rename to .env.staging.example diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 98f49f5..45e19c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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 @@ -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" @@ -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 diff --git a/README.md b/README.md index 0373d7e..3c54bac 100644 --- a/README.md +++ b/README.md @@ -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.