mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 01:02:08 +01:00
Fire tune build steps for mv3 version
This commit is contained in:
parent
dfde4643a2
commit
c583a2e4b0
2 changed files with 30 additions and 9 deletions
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
|
@ -49,6 +49,13 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
tools/make-mv3.sh full
|
tools/make-mv3.sh full
|
||||||
echo "MV3PACKAGE=$(basename $(ls dist/build/uBlock0_*.mv3.zip))" >> $GITHUB_ENV
|
echo "MV3PACKAGE=$(basename $(ls dist/build/uBlock0_*.mv3.zip))" >> $GITHUB_ENV
|
||||||
|
cp dist/build/uBlock0.mv3/log.txt dist/chromium-mv3/
|
||||||
|
- name: Commit MV3 build log file
|
||||||
|
# https://github.com/marketplace/actions/github-action-for-committing-changes-to-a-repository
|
||||||
|
uses: devops-infra/action-commit-push@master
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
commit_message: Update build log file
|
||||||
- name: Upload Chromium package
|
- name: Upload Chromium package
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -58,9 +58,6 @@ async function main() {
|
||||||
const rulesetDetails = [];
|
const rulesetDetails = [];
|
||||||
const outputDir = commandLineArgs.get('output') || '.';
|
const outputDir = commandLineArgs.get('output') || '.';
|
||||||
|
|
||||||
let goodTotalCount = 0;
|
|
||||||
let maybeGoodTotalCount = 0;
|
|
||||||
|
|
||||||
const output = [];
|
const output = [];
|
||||||
const log = (text, silent = false) => {
|
const log = (text, silent = false) => {
|
||||||
output.push(text);
|
output.push(text);
|
||||||
|
@ -69,6 +66,29 @@ async function main() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Get manifest content
|
||||||
|
const manifest = await fs.readFile(
|
||||||
|
`${outputDir}/manifest.json`,
|
||||||
|
{ encoding: 'utf8' }
|
||||||
|
).then(text =>
|
||||||
|
JSON.parse(text)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Create unique version number according to build time
|
||||||
|
let version = manifest.version;
|
||||||
|
{
|
||||||
|
const now = new Date();
|
||||||
|
const yearPart = now.getUTCFullYear() - 2000;
|
||||||
|
const monthPart = (now.getUTCMonth() + 1) * 1000;
|
||||||
|
const dayPart = now.getUTCDate() * 10;
|
||||||
|
const hourPart = Math.floor(now.getUTCHours() / 3) + 1;
|
||||||
|
version += `.${yearPart}.${monthPart + dayPart + hourPart}`;
|
||||||
|
}
|
||||||
|
log(`Version: ${version}`);
|
||||||
|
|
||||||
|
let goodTotalCount = 0;
|
||||||
|
let maybeGoodTotalCount = 0;
|
||||||
|
|
||||||
const replacer = (k, v) => {
|
const replacer = (k, v) => {
|
||||||
if ( k.startsWith('__') ) { return; }
|
if ( k.startsWith('__') ) { return; }
|
||||||
if ( Array.isArray(v) ) {
|
if ( Array.isArray(v) ) {
|
||||||
|
@ -243,12 +263,6 @@ async function main() {
|
||||||
log(`Total regex rules count: ${maybeGoodTotalCount}`);
|
log(`Total regex rules count: ${maybeGoodTotalCount}`);
|
||||||
|
|
||||||
// Patch manifest
|
// Patch manifest
|
||||||
const manifest = await fs.readFile(
|
|
||||||
`${outputDir}/manifest.json`,
|
|
||||||
{ encoding: 'utf8' }
|
|
||||||
).then(text =>
|
|
||||||
JSON.parse(text)
|
|
||||||
);
|
|
||||||
manifest.declarative_net_request = { rule_resources: ruleResources };
|
manifest.declarative_net_request = { rule_resources: ruleResources };
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const yearPart = now.getUTCFullYear() - 2000;
|
const yearPart = now.getUTCFullYear() - 2000;
|
||||||
|
|
Loading…
Reference in a new issue