diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 06549fc..d466ade 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,17 +57,24 @@ jobs: - name: Prepare Firefox source run: | - mkdir -p dist/firefox-source - rsync -a \ - --exclude '.git/' \ - --exclude '.github/' \ - --exclude 'web-ext-artifacts/' \ - --exclude 'manifest.chrome.json' \ - --exclude 'background-chrome.js' \ - --exclude 'background-service-worker.js' \ - --exclude 'browser-api.js' \ - --exclude 'scripts/' \ - ./ dist/firefox-source/ + python - <<'PY' + from pathlib import Path + import shutil + source = Path('.') + target = Path('dist/firefox-source') + excluded = {'.git', '.github', 'dist', 'web-ext-artifacts', 'scripts', + 'manifest.chrome.json', 'background-chrome.js', + 'background-service-worker.js', 'browser-api.js'} + target.mkdir(parents=True, exist_ok=True) + for item in source.iterdir(): + if item.name in excluded: + continue + destination = target / item.name + if item.is_dir(): + shutil.copytree(item, destination, dirs_exist_ok=True) + else: + shutil.copy2(item, destination) + PY - name: Build Firefox package run: | @@ -124,17 +131,24 @@ jobs: - name: Set up Firefox signing tools run: | npm install --global web-ext - mkdir -p dist/firefox-source - rsync -a \ - --exclude '.git/' \ - --exclude '.github/' \ - --exclude 'web-ext-artifacts/' \ - --exclude 'manifest.chrome.json' \ - --exclude 'background-chrome.js' \ - --exclude 'background-service-worker.js' \ - --exclude 'browser-api.js' \ - --exclude 'scripts/' \ - ./ dist/firefox-source/ + python - <<'PY' + from pathlib import Path + import shutil + source = Path('.') + target = Path('dist/firefox-source') + excluded = {'.git', '.github', 'dist', 'web-ext-artifacts', 'scripts', + 'manifest.chrome.json', 'background-chrome.js', + 'background-service-worker.js', 'browser-api.js'} + target.mkdir(parents=True, exist_ok=True) + for item in source.iterdir(): + if item.name in excluded: + continue + destination = target / item.name + if item.is_dir(): + shutil.copytree(item, destination, dirs_exist_ok=True) + else: + shutil.copy2(item, destination) + PY - name: Sign and submit Firefox package to AMO run: |