Skip to content

Commit

Permalink
Updated build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
D3VL-Jack committed Jul 15, 2023
1 parent 422cf43 commit 2161f93
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Build Extension
run: npm run build
- name: Zip Extension
run: zip -r ${{github.ref_name}}.zip build
run: zip -r ${{github.ref_name}}.zip ./build/*
- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down
17 changes: 11 additions & 6 deletions scripts/update-manifest.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
const fs = require("fs");
const path = require("path");

const manifest = path.join(__dirname, "../public/manifest.json");
const updateVersion = (file, version) => {
const filePath = path.join(__dirname, file);

const manifestJson = require(manifest);
const json = JSON.parse(fs.readFileSync(filePath, "utf8"));

manifestJson.version = process.argv[2];
json.version = version;

const json = JSON.stringify(manifestJson, null, 4);
const output = JSON.stringify(json, null, 4);

fs.writeFileSync(manifest, json);
fs.writeFileSync(filePath, output);

console.log("Updated manifest.json with version " + process.argv[2]);
console.log(`Updated ${file.split('/').pop()} with version ${version}`);
}

updateVersion("../public/manifest.json", process.argv[2]);
updateVersion("../package.json", process.argv[2]);

0 comments on commit 2161f93

Please sign in to comment.