From 514a8b62d6539713e62f59e9a6844b168e105771 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 20 Feb 2020 11:39:06 -0500 Subject: [PATCH 1/4] Added beta build to CI --- .github/workflows/ci.yml | 14 ++++++++++++++ manifest/beta-manifest-extra.json | 4 ++++ public/_locales/en/messages.json | 3 +++ webpack/webpack.common.js | 3 ++- webpack/webpack.manifest.js | 8 ++++++++ 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 manifest/beta-manifest-extra.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a80b241b..9066a782 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,3 +32,17 @@ jobs: name: FirefoxExtension path: dist + # Create Beta artifacts (Builds with the name changed to beta) + - name: Create Chrome Beta artifacts + run: npm run build:chrome -- --env.stream=beta + - uses: actions/upload-artifact@v1 + with: + name: ChromeExtensionBeta + path: dist + - name: Create Firefox Beta artifacts + run: npm run build:firefox -- --env.stream=beta + - uses: actions/upload-artifact@v1 + with: + name: FirefoxExtensionBeta + path: dist + diff --git a/manifest/beta-manifest-extra.json b/manifest/beta-manifest-extra.json new file mode 100644 index 00000000..ad44ea07 --- /dev/null +++ b/manifest/beta-manifest-extra.json @@ -0,0 +1,4 @@ +{ + "name": "__MSG_betaName__" +} + \ No newline at end of file diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 5e0d0407..3ec629a3 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -428,5 +428,8 @@ }, "whatUnlistedCheck": { "message": "This setting will significantly slow down SponsorBlock. Sponsor lookups require sending the video ID to the server. If you are concerned about unlisted video IDs being sent over the internet, enable this option." + }, + "betaName": { + "message": "BETA - SponsorBlock" } } diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index 162c8b50..99dbac35 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -42,7 +42,8 @@ module.exports = env => ({ ), new BuildManifest({ browser: env.browser, - pretty: env.mode === "production" + pretty: env.mode === "production", + stream: env.stream }) ] }); diff --git a/webpack/webpack.manifest.js b/webpack/webpack.manifest.js index eb66b999..7f8e1f3b 100644 --- a/webpack/webpack.manifest.js +++ b/webpack/webpack.manifest.js @@ -8,6 +8,7 @@ const fs = require('fs'); const manifest = require("../manifest/manifest.json"); const firefoxManifestExtra = require("../manifest/firefox-manifest-extra.json"); const chromeManifestExtra = require("../manifest/chrome-manifest-extra.json"); +const betaManifestExtra = require("../manifest/beta-manifest-extra.json"); // schema for options object const schema = { @@ -18,6 +19,9 @@ const schema = { }, pretty: { type: 'boolean' + }, + steam: { + type: 'string' } } }; @@ -40,6 +44,10 @@ class BuildManifest { mergeObjects(manifest, chromeManifestExtra); } + if (this.options.stream === "beta") { + mergeObjects(manifest, betaManifestExtra); + } + let result = JSON.stringify(manifest); if (this.options.pretty) result = JSON.stringify(manifest, null, 2); From b629b7d333bafc3ada3d24c64f169b2ed8ca8b4f Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 20 Feb 2020 12:14:01 -0500 Subject: [PATCH 2/4] Added basic release workflow --- .github/workflows/ci.yml | 13 +++++++++++++ .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9066a782..c649c1c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,9 @@ jobs: with: name: ChromeExtension path: dist + - uses: montudor/action-zip@v0.1.0 + with: + args: zip -qq -r ./builds/ChromeExtension.zip ./dist # Create Firefox artifacts - name: Create Firefox artifacts @@ -31,6 +34,9 @@ jobs: with: name: FirefoxExtension path: dist + - uses: montudor/action-zip@v0.1.0 + with: + args: zip -qq -r ./builds/FirefoxExtension.zip ./dist # Create Beta artifacts (Builds with the name changed to beta) - name: Create Chrome Beta artifacts @@ -39,10 +45,17 @@ jobs: with: name: ChromeExtensionBeta path: dist + - uses: montudor/action-zip@v0.1.0 + with: + args: zip -qq -r ./builds/ChromeExtensionBeta.zip ./dist + - name: Create Firefox Beta artifacts run: npm run build:firefox -- --env.stream=beta - uses: actions/upload-artifact@v1 with: name: FirefoxExtensionBeta path: dist + - uses: montudor/action-zip@v0.1.0 + with: + args: zip -qq -r ./builds/FirefoxExtensionBeta.zip ./dist diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..92759e03 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Upload Release Build + +on: release + +jobs: + + build: + name: Upload Release + runs-on: ubuntu-latest + + steps: + # Build Artifacts + - name: Build Artifacts + - uses: ./.github/workflows/ci + + # Upload each release asset + - name: Upload to release + uses: JasonEtco/upload-to-release@master + with: + args: ./builds/ChromeExtension.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload to release + uses: JasonEtco/upload-to-release@master + with: + args: ./builds/FirefoxExtension.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + From c8ec2922cf03432d69b8612d0c30535e2c763bd1 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 20 Feb 2020 12:17:51 -0500 Subject: [PATCH 3/4] Added makedir to CI --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c649c1c6..60e01530 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ jobs: with: name: ChromeExtension path: dist + - run: mkdir ./builds - uses: montudor/action-zip@v0.1.0 with: args: zip -qq -r ./builds/ChromeExtension.zip ./dist From 6a212b762a977c0c35ffcc5a7dd56700b347b6db Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 20 Feb 2020 12:21:30 -0500 Subject: [PATCH 4/4] Fixed invalid release workflow --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92759e03..1bb05345 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: steps: # Build Artifacts - name: Build Artifacts - - uses: ./.github/workflows/ci + uses: ./.github/workflows/ci # Upload each release asset - name: Upload to release