Skip to content

Commit

Permalink
Update build for Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
saltict committed May 24, 2024
1 parent 049e411 commit a0694ff
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/push-koni-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ jobs:
nextcloud-url: 'https://file.cdmteck.com'
nextcloud-username: ${{ secrets.NEXTCLOUD_USERNAME }}
nextcloud-password: ${{ secrets.NEXTCLOUD_PASSWORD }}
- name: Upload to Build Firefox to Nextcloud
id: nextcloud_upload_firefox
uses: trympet/nextcloud-artifacts-action@v2
with:
name: '${{ steps.setup_params.outputs.ref }}-build-firefox-${{ steps.setup_params.outputs.time_tag }}'
path: 'master-build-firefox.zip'
nextcloud-url: 'https://file.cdmteck.com'
nextcloud-username: ${{ secrets.NEXTCLOUD_USERNAME }}
nextcloud-password: ${{ secrets.NEXTCLOUD_PASSWORD }}
- name: Deploy Webrunner to Netlify
id: netlify_deployment
uses: nwtgck/[email protected]
Expand All @@ -91,4 +100,5 @@ jobs:
description: |
The Deployment has been completed.
- Extension: ${{ steps.nextcloud_upload.outputs.SHAREABLE_URL }}
- Extension (Firefox): ${{ steps.nextcloud_upload_firefox.outputs.SHAREABLE_URL }}
- Web-runner: ${{ steps.netlify_deployment.outputs.deploy-url }}
13 changes: 12 additions & 1 deletion .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
yarn install --immutable | grep -v 'YN0013'
yarn ${{ matrix.step }}
- name: Upload to Build to Nextcloud
- name: Upload Build to Nextcloud
id: nextcloud_upload
uses: trympet/nextcloud-artifacts-action@v2
with:
Expand All @@ -42,6 +42,16 @@ jobs:
nextcloud-username: ${{ secrets.NEXTCLOUD_USERNAME }}
nextcloud-password: ${{ secrets.NEXTCLOUD_PASSWORD }}

- name: Upload Firefox Build to Nextcloud
id: nextcloud_upload_firefox
uses: trympet/nextcloud-artifacts-action@v2
with:
name: 'master-build-firefox.zip'
path: 'master-build-firefox.zip'
nextcloud-url: 'https://file.cdmteck.com'
nextcloud-username: ${{ secrets.NEXTCLOUD_USERNAME }}
nextcloud-password: ${{ secrets.NEXTCLOUD_PASSWORD }}

- name: Deploy Webrunner to Netlify
id: netlify_deployment
uses: nwtgck/[email protected]
Expand All @@ -68,4 +78,5 @@ jobs:
description: |
Master is completed.
- Extension: ${{ steps.nextcloud_upload.outputs.SHAREABLE_URL }}
- Extension (Firefox): ${{ steps.nextcloud_upload_firefox.outputs.SHAREABLE_URL }}
- Web-runner: ${{ steps.netlify_deployment.outputs.deploy-url }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ tmp/
.pnp.*
cc-test-reporter
lerna-debug.log*
master-build-firefox.zip
master-build.zip
master-src.zip
npm-debug.log*
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"koni-ci-build-i18n": "./scripts/koni-ci-build-i18n.mjs",
"koni-ci-build-webapp": "./scripts/koni-ci-build-webapp.mjs",
"koni-ci-ghact-build": "./scripts/koni-ci-ghact-build.mjs",
"koni-ci-mv3-firefox": "./scripts/koni-ci-mv3-firefox.mjs",
"koni-ci-webapp-update-build-number": "./scripts/koni-ci-webapp-update-build-number.mjs",
"koni-dev-build-ts": "./scripts/koni-dev-build-ts.mjs"
},
Expand All @@ -31,8 +32,9 @@
"build:release": "koni-ci-ghact-build",
"build:rollup": "polkadot-exec-rollup --config",
"build:ui": "cd packages/extension-koni && NODE_ENV=production yarn webpack --config webpack.extension.cjs --mode production",
"build:zip": "yarn build:zip:dst && yarn build:zip:src",
"build:zip": "yarn build:zip:dst && yarn build:zip:ff && yarn build:zip:src",
"build:zip:dst": "rm -rf ./master-build.zip && cd packages/extension-koni/build && zip -r -FS ../../../master-build.zip .",
"build:zip:ff": "koni-ci-mv3-firefox && rm -rf ./master-build-firefox.zip && cd packages/extension-koni/build && zip -r -FS ../../../master-build-firefox.zip .",
"build:zip:src": "rm -rf ./master-src.zip && zip -r -x '*build/*' -x '*node_modules*' -FS ./master-src.zip packages .editorconfig .eslintignore .eslintrc.js babel.config.cjs CHANGELOG.md CONTRIBUTING.md i18next-scanner.config.js jest.config.cjs LICENSE package.json README.md tsconfig.json yarn.lock",
"clean": "polkadot-dev-clean-build",
"dev": "yarn watch-dev",
Expand Down
27 changes: 27 additions & 0 deletions scripts/koni-ci-mv3-firefox.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import fs from 'fs/promises';
import path from 'path';

async function updateManifest() {
const filePath = path.resolve('./packages/extension-koni/build/manifest.json');

try {
// Read the manifest.json file
const data = await fs.readFile(filePath, 'utf8');
const manifest = JSON.parse(data);

// Update the "background" property
if (manifest.background && manifest.background['service-worker']) {
manifest.background = {
script: manifest.background['service-worker']
};
}

// Write the updated manifest back to the file
await fs.writeFile(filePath, JSON.stringify(manifest, null, 2));
console.log('manifest.json has been updated successfully.');
} catch (error) {
console.error('Error updating manifest.json:', error);
}
}

updateManifest();
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24691,6 +24691,7 @@ __metadata:
koni-ci-build-i18n: ./scripts/koni-ci-build-i18n.mjs
koni-ci-build-webapp: ./scripts/koni-ci-build-webapp.mjs
koni-ci-ghact-build: ./scripts/koni-ci-ghact-build.mjs
koni-ci-mv3-firefox: ./scripts/koni-ci-mv3-firefox.mjs
koni-ci-webapp-update-build-number: ./scripts/koni-ci-webapp-update-build-number.mjs
koni-dev-build-ts: ./scripts/koni-dev-build-ts.mjs
languageName: unknown
Expand Down

0 comments on commit a0694ff

Please sign in to comment.