Removed outdated images #869
This file contains hidden or 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: 'Compile for Firefox' | |
| on: | |
| push: | |
| branches: [ 'main' ] | |
| pull_request: | |
| branches: [ 'main' ] | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 'Checkout Repository' | |
| uses: actions/checkout@v7 | |
| - name: 'Extract Version' | |
| id: get_version | |
| run: | | |
| VERSION=$(jq -r '.version' src/main/manifest.json) | |
| echo "VERSION=$VERSION" >> "$GITHUB_ENV" | |
| - name: 'Remove update_url from manifest.json' | |
| run: | | |
| jq 'del(.update_url)' src/main/manifest.json > src/main/manifest_temp.json | |
| mv src/main/manifest_temp.json src/main/manifest.json | |
| - name: 'Remove incognito from manifest.json' | |
| run: | | |
| jq 'del(.incognito)' src/main/manifest.json > src/main/manifest_temp.json | |
| mv src/main/manifest_temp.json src/main/manifest.json | |
| - name: 'Remove storage from manifest.json' | |
| run: | | |
| jq 'del(.storage)' src/main/manifest.json > src/main/manifest_temp.json | |
| mv src/main/manifest_temp.json src/main/manifest.json | |
| - name: 'Add menus permission' | |
| run: | | |
| jq '.permissions += ["menus"]' src/main/manifest.json > src/main/manifest_temp.json | |
| mv src/main/manifest_temp.json src/main/manifest.json | |
| - name: 'Replace service_worker with page' | |
| run: | | |
| jq '.background = {"page": "background.html"}' src/main/manifest.json > src/main/manifest_temp.json | |
| mv src/main/manifest_temp.json src/main/manifest.json | |
| - name: 'Add browser_specific_settings for Firefox' | |
| run: | | |
| jq '. += {"browser_specific_settings":{"gecko":{"id":"osprey@foulest.net","strict_min_version":"140.0","data_collection_permissions":{"required":["browsingActivity"]}},"gecko_android":{"strict_min_version":"142.0"}}}' src/main/manifest.json > src/main/manifest_temp.json | |
| mv src/main/manifest_temp.json src/main/manifest.json | |
| - name: 'Stage Build Output' | |
| run: | | |
| rm -rf dist | |
| cp -r src/main dist | |
| - name: 'Cache NPM Downloads' | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.npm | |
| key: npm-tools-${{ runner.os }}-htmlminifierterser7-terser5-cleancss5-svgo3 | |
| - name: 'Install Minifiers' | |
| run: | | |
| npm install -g \ | |
| html-minifier-terser@7 \ | |
| terser@5 \ | |
| clean-css-cli@5 \ | |
| svgo@3 | |
| - name: 'Minify HTML, CSS, JS, JSON' | |
| run: | | |
| find dist -name '*.html' -exec html-minifier-terser \ | |
| --collapse-whitespace --remove-comments \ | |
| --minify-css true --minify-js true -o {} {} \; | |
| find dist -name '*.css' -exec cleancss -o {} {} \; | |
| find dist -name '*.js' -exec terser {} -c -m -o {} \; | |
| find dist -name '*.json' -exec sh -c 'jq -c . "$1" > "$1.tmp" && mv "$1.tmp" "$1"' _ {} \; | |
| - name: 'Upload Artifact' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Osprey-${{ env.VERSION }}-firefox | |
| path: dist | |
| compression-level: 9 | |
| if-no-files-found: error |