Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
276 changes: 236 additions & 40 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,69 +1,265 @@
name: Release
name: Release (GitHub + Chrome Web Store)

on:
pull_request:
types: [closed]
types: [opened, synchronize, reopened, closed]
branches: [master]
push:
branches: [master]

permissions:
contents: write
pull-requests: read

env:
NODE_VERSION: "20"
ZIP_NAME: extension.zip
PKG_DIR: .cws-package

jobs:
release:
if: github.event.pull_request.merged == true
# A) PR is open: if any commit message contains [test-release],
# create a GitHub PRE-release and publish to a TEST listing (Trusted Testers).
pr-test-release:
if: github.event_name == 'pull_request' && github.event.action != 'closed'
runs-on: ubuntu-latest
steps:
- name: Check PR is from same repo (secrets unavailable for forks)
id: same-repo
run: |
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
echo "from_fork=true" >> $GITHUB_OUTPUT
else
echo "from_fork=false" >> $GITHUB_OUTPUT
fi

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js 20
uses: actions/setup-node@v4
- name: Detect [test-release] in PR commits
id: detect
uses: actions/github-script@v7
with:
node-version: 20
cache: npm
script: |
const {owner, repo} = context.repo;
const number = context.payload.pull_request.number;
const resp = await github.rest.pulls.listCommits({ owner, repo, pull_number: number, per_page: 250 });
const has = resp.data.some(c => /\[test-release\]/i.test(c.commit.message));
core.info(`Found [test-release] in PR #${number} commits: ${has}`);
core.setOutput('has_test', has ? 'true' : 'false');

- name: Install dependencies
run: npm ci
- name: Stop early if not a test-release or from a fork
if: steps.detect.outputs.has_test != 'true' || steps.same-repo.outputs.from_fork == 'true'
run: echo "Skipping test release."

- name: Build (production)
run: npm run build
- name: Resolve TEST extension id
if: steps.detect.outputs.has_test == 'true' && steps.same-repo.outputs.from_fork != 'true'
id: extid
run: |
if [ -n "${{ vars.CWS_EXTENSION_ID_TEST }}" ]; then
echo "id=${{ vars.CWS_EXTENSION_ID_TEST }}" >> $GITHUB_OUTPUT
else
# fall back to production id if a TEST id wasn't provided
echo "id=${{ vars.CWS_EXTENSION_ID }}" >> $GITHUB_OUTPUT
fi

- name: Make package script executable
run: chmod +x scripts/package.sh
- name: Setup Node
if: steps.detect.outputs.has_test == 'true' && steps.same-repo.outputs.from_fork != 'true'
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Package extension ZIP
id: pkg
- name: Install & Build
if: steps.detect.outputs.has_test == 'true' && steps.same-repo.outputs.from_fork != 'true'
run: |
./scripts/package.sh production
echo "zip=$(ls -1 release/*.zip | head -n1)" >> "$GITHUB_OUTPUT"
if [ -f pnpm-lock.yaml ]; then
corepack enable
pnpm i --frozen-lockfile
pnpm build || true
elif [ -f yarn.lock ]; then
yarn --frozen-lockfile
yarn build || true
elif [ -f package-lock.json ]; then
npm ci
npm run build || true
fi

- name: Read version from manifest
id: ver
run: echo "version=$(jq -r .version manifest.json)" >> "$GITHUB_OUTPUT"
- name: Package Chrome extension (ensure manifest at ZIP root)
if: steps.detect.outputs.has_test == 'true' && steps.same-repo.outputs.from_fork != 'true'
run: |
set -euo pipefail
rm -rf "${{ env.PKG_DIR }}" "${{ env.ZIP_NAME }}"
mkdir -p "${{ env.PKG_DIR }}"
OUT=""
for d in dist build release; do
if [ -d "$d" ]; then OUT="$d"; break; fi
done
if [ -z "$OUT" ]; then OUT="."; fi
if [ "$OUT" = "." ]; then
for p in manifest.json icons assets _locales images styles css js lib src background content popup options; do
[ -e "$p" ] && rsync -a --exclude 'node_modules' --exclude '.git' --exclude '.github' "$p" "${{ env.PKG_DIR }}/"
done
else
rsync -a "$OUT"/ "${{ env.PKG_DIR }}/"
if [ ! -f "${{ env.PKG_DIR }}/manifest.json" ] && [ -f "manifest.json" ]; then
cp manifest.json "${{ env.PKG_DIR }}/"
fi
for d in icons assets _locales images; do
if [ ! -e "${{ env.PKG_DIR }}/$d" ] && [ -e "$d" ]; then rsync -a "$d" "${{ env.PKG_DIR }}/"; fi
done
fi
test -f "${{ env.PKG_DIR }}/manifest.json" || { echo "::error::manifest.json not found at ZIP root"; ls -la "${{ env.PKG_DIR }}"; exit 1; }
(cd "${{ env.PKG_DIR }}" && zip -qr "../${{ env.ZIP_NAME }}" .)
ls -lh "${{ env.ZIP_NAME }}"

- name: Upload ZIP artifact
uses: actions/upload-artifact@v4
- name: Create GitHub pre-release (test)
if: steps.detect.outputs.has_test == 'true' && steps.same-repo.outputs.from_fork != 'true'
uses: softprops/action-gh-release@v2
with:
name: extension-zip
path: ${{ steps.pkg.outputs.zip }}
if-no-files-found: error
compression-level: 0
tag_name: pr-test-${{ github.event.pull_request.number }}-${{ github.run_number }}
name: PR Test Release #${{ github.event.pull_request.number }} (run ${{ github.run_number }})
prerelease: true
generate_release_notes: true
files: ${{ env.ZIP_NAME }}

- name: Create GitHub Release
- name: Publish to Chrome Web Store (TEST — Trusted Testers)
if: steps.detect.outputs.has_test == 'true' && steps.same-repo.outputs.from_fork != 'true'
uses: browser-actions/release-chrome-extension@v0
continue-on-error: true # don't fail the whole job if the listing is locked
with:
extension-id: ${{ steps.extid.outputs.id }}
extension-path: ${{ env.ZIP_NAME }}
oauth-client-id: ${{ vars.CWS_CLIENT_ID }}
oauth-client-secret: ${{ secrets.CWS_CLIENT_SECRET }}
oauth-refresh-token: ${{ secrets.CWS_REFRESH_TOKEN }}
publish-target: trustedTesters

# B) When PR is merged into master: always release to GitHub and CWS (production).
pr-merge-release:
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install & Build
run: |
if [ -f pnpm-lock.yaml ]; then
corepack enable
pnpm i --frozen-lockfile
pnpm build || true
elif [ -f yarn.lock ]; then
yarn --frozen-lockfile
yarn build || true
elif [ -f package-lock.json ]; then
npm ci
npm run build || true
fi
- name: Package Chrome extension (ensure manifest at ZIP root)
run: |
set -euo pipefail
rm -rf "${{ env.PKG_DIR }}" "${{ env.ZIP_NAME }}"
mkdir -p "${{ env.PKG_DIR }}"
OUT=""
for d in dist build release; do
if [ -d "$d" ]; then OUT="$d"; break; fi
done
[ -z "$OUT" ] && OUT="."
if [ "$OUT" = "." ]; then
for p in manifest.json icons assets _locales images styles css js lib src background content popup options; do
[ -e "$p" ] && rsync -a --exclude 'node_modules' --exclude '.git' --exclude '.github' "$p" "${{ env.PKG_DIR }}/"
done
else
rsync -a "$OUT"/ "${{ env.PKG_DIR }}/"
[ ! -f "${{ env.PKG_DIR }}/manifest.json" ] && [ -f "manifest.json" ] && cp manifest.json "${{ env.PKG_DIR }}/"
for d in icons assets _locales images; do
[ ! -e "${{ env.PKG_DIR }}/$d" ] && [ -e "$d" ] && rsync -a "$d" "${{ env.PKG_DIR }}/"
done
fi
test -f "${{ env.PKG_DIR }}/manifest.json" || { echo "::error::manifest.json not found"; exit 1; }
(cd "${{ env.PKG_DIR }}" && zip -qr "../${{ env.ZIP_NAME }}" .)
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.ver.outputs.version }}-${{ github.sha }}
name: v${{ steps.ver.outputs.version }} (PR #${{ github.event.pull_request.number }})
tag_name: auto-pr-${{ github.event.pull_request.number }}-${{ github.run_number }}
name: Auto release for PR #${{ github.event.pull_request.number }}
generate_release_notes: true
files: ${{ steps.pkg.outputs.zip }}
files: ${{ env.ZIP_NAME }}
- name: Publish to Chrome Web Store (production)
uses: browser-actions/release-chrome-extension@v0
with:
extension-id: ${{ vars.CWS_EXTENSION_ID }}
extension-path: ${{ env.ZIP_NAME }}
oauth-client-id: ${{ vars.CWS_CLIENT_ID }}
oauth-client-secret: ${{ secrets.CWS_CLIENT_SECRET }}
oauth-refresh-token: ${{ secrets.CWS_REFRESH_TOKEN }}
publish-target: default

- name: Upload to Chrome Web Store (optional)
if: ${{ secrets.CHROME_CLIENT_ID != '' && secrets.CHROME_CLIENT_SECRET != '' && secrets.CHROME_REFRESH_TOKEN != '' && secrets.CHROME_EXTENSION_ID != '' }}
uses: Klemensas/chrome-extension-deploy@v2
# C) Any push to master with a commit message containing [release]:
# release to GitHub and CWS (production).
push-release-flag:
if: github.event_name == 'push' && contains(toJson(github.event.commits), '[release]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install & Build
run: |
if [ -f pnpm-lock.yaml ]; then
corepack enable
pnpm i --frozen-lockfile
pnpm build || true
elif [ -f yarn.lock ]; then
yarn --frozen-lockfile
yarn build || true
elif [ -f package-lock.json ]; then
npm ci
npm run build || true
fi
- name: Package Chrome extension (ensure manifest at ZIP root)
run: |
set -euo pipefail
rm -rf "${{ env.PKG_DIR }}" "${{ env.ZIP_NAME }}"
mkdir -p "${{ env.PKG_DIR }}"
OUT=""
for d in dist build release; do
if [ -d "$d" ]; then OUT="$d"; break; fi
done
[ -z "$OUT" ] && OUT="."
if [ "$OUT" = "." ]; then
for p in manifest.json icons assets _locales images styles css js lib src background content popup options; do
[ -e "$p" ] && rsync -a --exclude 'node_modules' --exclude '.git' --exclude '.github' "$p" "${{ env.PKG_DIR }}/"
done
else
rsync -a "$OUT"/ "${{ env.PKG_DIR }}/"
[ ! -f "${{ env.PKG_DIR }}/manifest.json" ] && [ -f "manifest.json" ] && cp manifest.json "${{ env.PKG_DIR }}/"
for d in icons assets _locales images; do
[ ! -e "${{ env.PKG_DIR }}/$d" ] && [ -e "$d" ] && rsync -a "$d" "${{ env.PKG_DIR }}/"
done
fi
test -f "${{ env.PKG_DIR }}/manifest.json" || { echo "::error::manifest.json not found"; exit 1; }
(cd "${{ env.PKG_DIR }}" && zip -qr "../${{ env.ZIP_NAME }}" .)
- name: Create GitHub release (flagged)
uses: softprops/action-gh-release@v2
with:
tag_name: flagged-release-${{ github.run_number }}
name: Flagged [release] — run ${{ github.run_number }}
generate_release_notes: true
files: ${{ env.ZIP_NAME }}
- name: Publish to Chrome Web Store (production)
uses: browser-actions/release-chrome-extension@v0
with:
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
file-name: ${{ steps.pkg.outputs.zip }}
app-id: ${{ secrets.CHROME_EXTENSION_ID }}
publish: true
extension-id: ${{ vars.CWS_EXTENSION_ID }}
extension-path: ${{ env.ZIP_NAME }}
oauth-client-id: ${{ vars.CWS_CLIENT_ID }}
oauth-client-secret: ${{ secrets.CWS_CLIENT_SECRET }}
oauth-refresh-token: ${{ secrets.CWS_REFRESH_TOKEN }}
publish-target: default
2 changes: 0 additions & 2 deletions TODO.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
- youtube, need button scrape and button scrape+scroll
- Pinterest - Separate Find more ideas


- persistent renaming of rows

Fix issue when google introduces ads link:
youtube,playlist,Watch later,video,https://www.youtube.com/watch?v=mVrCPo8eB3A&pp=ugUEEgJlbg%3D%3D
youtube,playlist,Watch later,video,https://www.youtube.com/watch?v=kDJ8mucd4R0&list=RDMMkDJ8mucd4R0&start_radio=1
youtube,playlist,Watch later,video,https://www.googleadservices.com/pagead/aclk?sa=L&ai=CdeE9ldbZaJ_oOduOrckPiYjkqQyEzoaVggGLxoyOlRS0kB8QAyAAYP2AgIDwA4IBF2NhLXB1Yi02MjE5ODExNzQ3MDQ5MzcxoAH7mbH8AagDBMgDCqoE3QFP0Bk66w-WuUcVOPcPysptVeCDJ6fsNGRFFABXh6i3JaJp0NTHJde5HjDlR9yofB0r1trWRj5dRekjbiFlbCb9WY8rq5TBs8nAgTFVNZEXOaL6BK97CRw30HmHx5Y6HyTZW67HmNNs3y-m5RGN9HTETcIePoVegcpstyFoKWDllKCF8QguYhFb_bz-XUrFOat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Y2FtcGFpZ25pZD0yMjI4NTY1OTk3NyZ3YnJhaWQ9Q2tVS0NRand1ZVBHQmhEOEFSSTBBQjc0dUlXS1JjNExWOWRRUWdmT29FcnFCcmdNS1lJS3lHZTZqWWJtcnJCLXhBaVhTbTBhbXlzTU1BdHZUdEp3M1A3M3NSb0NkeVG4E____________wGwFALAFYGAgEDQFQHYFQGYFgHiFgIIAYAXAYoXFggDGAEgASgBMAE4AUABSAFQAVgBYAKgFwGpF3KGLYxyiuC0uhcKEAEoADABOAFIAdAYAfAYAYAZA8IZAggB&ase=2&gclid=CjwKCAjwuePGBhBZEiwAIGCVSyDJZk_VAqXXg7rbmBN_0r7jh90qDFAAVWuK_gdQBnF2HTnQoRYHYhoCHAYQAvD_BwE&num=3&cid=CAESD-D25y3WBLC63_vwC0iwLw&ad_cpn=%5BCPN%5D&sig=AOD64_1JHEkkZQnd3JIgySmL4FJB21QQdw&ctype=110&video_id=3vZYWp-0zEQ&label=video_click_to_advertiser_site&ms=%5BCLICK_MS%5D&nb=21&nx=%5BNX%5D&ny=%5BNY%5D&dim=%5BDIM%5D


reename "instagram-controls-section" to universal thing
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "listr",
"version": "1.0.2",
"version": "1.0.3",
"description": "Displays a popup with bookmarks and more.",
"icons": {
"16": "assets/icons/icon-16.png",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "listr",
"version": "1.0.2",
"version": "1.0.3",
"description": "Get bookmarks and favorites from your favorite social media platforms.",
"scripts": {
"build": "webpack --mode production",
Expand Down
Loading