From 89988998d8549c85562d058563f13c752e285d2c Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sun, 19 Dec 2021 07:21:04 +0530 Subject: [PATCH 01/20] test action --- .../azure-static-web-apps-deploy.yml | 101 ++++++++++++++++++ manifest.test.xml | 85 +++++++++++++++ 2 files changed, 186 insertions(+) create mode 100644 manifest.test.xml diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 3ad3422e..2ed803ea 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -21,6 +21,107 @@ jobs: with: submodules: true + - name: Get PR info + uses: jwalton/gh-find-current-pr@v1 + id: findPr + with: + state: open + run: echo "Your PR is ${PR}" + if: success() && steps.findPr.outputs.number + env: + PR: ${{ steps.findPr.outputs.pr }} + + - name: Write File + uses: DamianReeves/write-file-action@v1.0 + with: + path: ${{env.home}}/manifest.test.xml + content: | + + + 8d3834a1-56b7-40a7-964b-e3393b71a062 + 1.0.0.0 + JabRef + en-US + + + + + + + https://www.jabref.org + + + + + + + + ReadWriteDocument + + + + + + + <Description resid="GetStarted.Description"/> + <LearnMoreUrl resid="GetStarted.LearnMoreUrl"/> + </GetStarted> + <FunctionFile resid="Commands.Url"/> + <ExtensionPoint xsi:type="PrimaryCommandSurface"> + <OfficeTab id="TabReferences"> + <Group id="CommandsGroup"> + <Label resid="CommandsGroup.Label"/> + <Icon> + <bt:Image size="16" resid="Icon.16x16"/> + <bt:Image size="32" resid="Icon.32x32"/> + <bt:Image size="80" resid="Icon.80x80"/> + </Icon> + <Control xsi:type="Button" id="TaskpaneButton"> + <Label resid="TaskpaneButton.Label"/> + <Supertip> + <Title resid="TaskpaneButton.Label"/> + <Description resid="TaskpaneButton.Tooltip"/> + </Supertip> + <Icon> + <bt:Image size="16" resid="Icon.16x16"/> + <bt:Image size="32" resid="Icon.32x32"/> + <bt:Image size="80" resid="Icon.80x80"/> + </Icon> + <Action xsi:type="ShowTaskpane"> + <TaskpaneId>ButtonId1</TaskpaneId> + <SourceLocation resid="Taskpane.Url"/> + </Action> + </Control> + </Group> + </OfficeTab> + </ExtensionPoint> + </DesktopFormFactor> + </Host> + </Hosts> + <Resources> + <bt:Images> + <bt:Image id="Icon.16x16" DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/assets/jabref-icon-16.png"/> + <bt:Image id="Icon.32x32" DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/assets/jabref-icon-32.png"/> + <bt:Image id="Icon.80x80" DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/assets/jabref-icon-80.png"/> + </bt:Images> + <bt:Urls> + <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/> + <bt:Url id="Commands.Url" DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/commands.html"/> + <bt:Url id="Taskpane.Url" DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/taskpane.html"/> + </bt:Urls> + <bt:ShortStrings> + <bt:String id="GetStarted.Title" DefaultValue="Get started with your sample add-in!"/> + <bt:String id="CommandsGroup.Label" DefaultValue="Commands Group"/> + <bt:String id="TaskpaneButton.Label" DefaultValue="JabRef"/> + </bt:ShortStrings> + <bt:LongStrings> + <bt:String id="GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started."/> + <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane"/> + </bt:LongStrings> + </Resources> + </VersionOverrides> + </OfficeApp> + write-mode: overwrite - name: Build and deploy to Azure uses: Azure/static-web-apps-deploy@v1 with: diff --git a/manifest.test.xml b/manifest.test.xml new file mode 100644 index 00000000..38fe2766 --- /dev/null +++ b/manifest.test.xml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp"> + <Id>8d3834a1-56b7-40a7-964b-e3393b71a062</Id> + <Version>1.0.0.0</Version> + <ProviderName>JabRef</ProviderName> + <DefaultLocale>en-US</DefaultLocale> + <DisplayName DefaultValue="JabRef"/> + <Description DefaultValue="JabRef Word Add-in"/> + <IconUrl DefaultValue="https://localhost:3000/assets/jabref-icon-32.png"/> + <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/jabref-icon-64.png"/> + <SupportUrl DefaultValue="https://www.jabref.org/#support"/> + <AppDomains> + <AppDomain>https://www.jabref.org</AppDomain> + </AppDomains> + <Hosts> + <Host Name="Document"/> + </Hosts> + <DefaultSettings> + <SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/> + </DefaultSettings> + <Permissions>ReadWriteDocument</Permissions> + <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0"> + <Hosts> + <Host xsi:type="Document"> + <DesktopFormFactor> + <GetStarted> + <Title resid="GetStarted.Title"/> + <Description resid="GetStarted.Description"/> + <LearnMoreUrl resid="GetStarted.LearnMoreUrl"/> + </GetStarted> + <FunctionFile resid="Commands.Url"/> + <ExtensionPoint xsi:type="PrimaryCommandSurface"> + <OfficeTab id="TabReferences"> + <Group id="CommandsGroup"> + <Label resid="CommandsGroup.Label"/> + <Icon> + <bt:Image size="16" resid="Icon.16x16"/> + <bt:Image size="32" resid="Icon.32x32"/> + <bt:Image size="80" resid="Icon.80x80"/> + </Icon> + <Control xsi:type="Button" id="TaskpaneButton"> + <Label resid="TaskpaneButton.Label"/> + <Supertip> + <Title resid="TaskpaneButton.Label"/> + <Description resid="TaskpaneButton.Tooltip"/> + </Supertip> + <Icon> + <bt:Image size="16" resid="Icon.16x16"/> + <bt:Image size="32" resid="Icon.32x32"/> + <bt:Image size="80" resid="Icon.80x80"/> + </Icon> + <Action xsi:type="ShowTaskpane"> + <TaskpaneId>ButtonId1</TaskpaneId> + <SourceLocation resid="Taskpane.Url"/> + </Action> + </Control> + </Group> + </OfficeTab> + </ExtensionPoint> + </DesktopFormFactor> + </Host> + </Hosts> + <Resources> + <bt:Images> + <bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/jabref-icon-16.png"/> + <bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/jabref-icon-32.png"/> + <bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/jabref-icon-80.png"/> + </bt:Images> + <bt:Urls> + <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/> + <bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/> + <bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/> + </bt:Urls> + <bt:ShortStrings> + <bt:String id="GetStarted.Title" DefaultValue="Get started with your sample add-in!"/> + <bt:String id="CommandsGroup.Label" DefaultValue="Commands Group"/> + <bt:String id="TaskpaneButton.Label" DefaultValue="JabRef"/> + </bt:ShortStrings> + <bt:LongStrings> + <bt:String id="GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started."/> + <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane"/> + </bt:LongStrings> + </Resources> + </VersionOverrides> +</OfficeApp> From 0d5eaf0373ef673650d92e0dccbb2d77bdee361a Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sun, 19 Dec 2021 09:13:02 +0530 Subject: [PATCH 02/20] test without updating file --- .../azure-static-web-apps-deploy.yml | 91 ------------------- 1 file changed, 91 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 2ed803ea..3e7cedd0 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -31,97 +31,6 @@ jobs: env: PR: ${{ steps.findPr.outputs.pr }} - - name: Write File - uses: DamianReeves/write-file-action@v1.0 - with: - path: ${{env.home}}/manifest.test.xml - content: | - <?xml version="1.0" encoding="UTF-8" standalone="yes"?> - <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp"> - <Id>8d3834a1-56b7-40a7-964b-e3393b71a062</Id> - <Version>1.0.0.0</Version> - <ProviderName>JabRef</ProviderName> - <DefaultLocale>en-US</DefaultLocale> - <DisplayName DefaultValue="JabRef"/> - <Description DefaultValue="JabRef Word Add-in"/> - <IconUrl DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/assets/jabref-icon-32.png"/> - <HighResolutionIconUrl DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/assets/jabref-icon-64.png"/> - <SupportUrl DefaultValue="https://www.jabref.org/#support"/> - <AppDomains> - <AppDomain>https://www.jabref.org</AppDomain> - </AppDomains> - <Hosts> - <Host Name="Document"/> - </Hosts> - <DefaultSettings> - <SourceLocation DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/taskpane.html"/> - </DefaultSettings> - <Permissions>ReadWriteDocument</Permissions> - <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0"> - <Hosts> - <Host xsi:type="Document"> - <DesktopFormFactor> - <GetStarted> - <Title resid="GetStarted.Title"/> - <Description resid="GetStarted.Description"/> - <LearnMoreUrl resid="GetStarted.LearnMoreUrl"/> - </GetStarted> - <FunctionFile resid="Commands.Url"/> - <ExtensionPoint xsi:type="PrimaryCommandSurface"> - <OfficeTab id="TabReferences"> - <Group id="CommandsGroup"> - <Label resid="CommandsGroup.Label"/> - <Icon> - <bt:Image size="16" resid="Icon.16x16"/> - <bt:Image size="32" resid="Icon.32x32"/> - <bt:Image size="80" resid="Icon.80x80"/> - </Icon> - <Control xsi:type="Button" id="TaskpaneButton"> - <Label resid="TaskpaneButton.Label"/> - <Supertip> - <Title resid="TaskpaneButton.Label"/> - <Description resid="TaskpaneButton.Tooltip"/> - </Supertip> - <Icon> - <bt:Image size="16" resid="Icon.16x16"/> - <bt:Image size="32" resid="Icon.32x32"/> - <bt:Image size="80" resid="Icon.80x80"/> - </Icon> - <Action xsi:type="ShowTaskpane"> - <TaskpaneId>ButtonId1</TaskpaneId> - <SourceLocation resid="Taskpane.Url"/> - </Action> - </Control> - </Group> - </OfficeTab> - </ExtensionPoint> - </DesktopFormFactor> - </Host> - </Hosts> - <Resources> - <bt:Images> - <bt:Image id="Icon.16x16" DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/assets/jabref-icon-16.png"/> - <bt:Image id="Icon.32x32" DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/assets/jabref-icon-32.png"/> - <bt:Image id="Icon.80x80" DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/assets/jabref-icon-80.png"/> - </bt:Images> - <bt:Urls> - <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/> - <bt:Url id="Commands.Url" DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/commands.html"/> - <bt:Url id="Taskpane.Url" DefaultValue="https://lively-ground-0d7c50410-${{steps.findPr.outputs.number}}.centralus.azurestaticapps.net/taskpane.html"/> - </bt:Urls> - <bt:ShortStrings> - <bt:String id="GetStarted.Title" DefaultValue="Get started with your sample add-in!"/> - <bt:String id="CommandsGroup.Label" DefaultValue="Commands Group"/> - <bt:String id="TaskpaneButton.Label" DefaultValue="JabRef"/> - </bt:ShortStrings> - <bt:LongStrings> - <bt:String id="GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started."/> - <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane"/> - </bt:LongStrings> - </Resources> - </VersionOverrides> - </OfficeApp> - write-mode: overwrite - name: Build and deploy to Azure uses: Azure/static-web-apps-deploy@v1 with: From 64edc0e6bd036c1858e969c1299b222a56477124 Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sun, 19 Dec 2021 09:15:07 +0530 Subject: [PATCH 03/20] revert changes --- .github/workflows/azure-static-web-apps-deploy.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 3e7cedd0..3ad3422e 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -21,16 +21,6 @@ jobs: with: submodules: true - - name: Get PR info - uses: jwalton/gh-find-current-pr@v1 - id: findPr - with: - state: open - run: echo "Your PR is ${PR}" - if: success() && steps.findPr.outputs.number - env: - PR: ${{ steps.findPr.outputs.pr }} - - name: Build and deploy to Azure uses: Azure/static-web-apps-deploy@v1 with: From 9c3d456c68c59458a471d2ccc15cfcda2c79a031 Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 19:52:39 +0530 Subject: [PATCH 04/20] update build command --- .eslintignore | 1 + .github/workflows/azure-static-web-apps-deploy.yml | 1 + webpack.config.js | 11 +++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.eslintignore b/.eslintignore index e4163d65..2f6730c1 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ /src/generated/ +webpack.config.js diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 3ad3422e..bb6993f9 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -29,6 +29,7 @@ jobs: action: "upload" # App source code path app_location: "/" + app_build_command: "npm run build --env urlProd=$(jq --raw-output .pull_request.number '$GITHUB_EVENT_PATH')" # Built app content directory output_location: "dist" diff --git a/webpack.config.js b/webpack.config.js index e395135b..3be506c9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,11 +6,12 @@ const HtmlWebpackPlugin = require("html-webpack-plugin"); const webpack = require("webpack"); var dotenv = require("dotenv").config({ path: __dirname + "/.env" }); -const urlDev = "https://localhost:3000/"; -const urlProd = "https://www.contoso.com/"; // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION +const urlDev = process.env.urlDev || "https://localhost:3000/"; +const prodUrl = "https://www.contoso.com/"; // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION module.exports = async (env, options) => { const dev = options.mode === "development"; + const urlProd = env.urlProd || prodUrl; const buildType = dev ? "dev" : "prod"; const config = { devtool: "source-map", @@ -65,7 +66,9 @@ module.exports = async (env, options) => { if (dev) { return content; } else { - return content.toString().replace(new RegExp(urlDev, "g"), urlProd); + return content + .toString() + .replace(new RegExp(urlDev, "g"), urlProd); } }, }, @@ -105,7 +108,7 @@ module.exports = async (env, options) => { ? options.https : await devCerts.getHttpsServerOptions(), port: process.env.npm_package_config_dev_server_port || 3000, - } + }; } return config; From a5e59cdeccdfeb9b2d7ce3eb66482481273b2f72 Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 19:55:54 +0530 Subject: [PATCH 05/20] remove test file --- manifest.test.xml | 85 ----------------------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 manifest.test.xml diff --git a/manifest.test.xml b/manifest.test.xml deleted file mode 100644 index 38fe2766..00000000 --- a/manifest.test.xml +++ /dev/null @@ -1,85 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp"> - <Id>8d3834a1-56b7-40a7-964b-e3393b71a062</Id> - <Version>1.0.0.0</Version> - <ProviderName>JabRef</ProviderName> - <DefaultLocale>en-US</DefaultLocale> - <DisplayName DefaultValue="JabRef"/> - <Description DefaultValue="JabRef Word Add-in"/> - <IconUrl DefaultValue="https://localhost:3000/assets/jabref-icon-32.png"/> - <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/jabref-icon-64.png"/> - <SupportUrl DefaultValue="https://www.jabref.org/#support"/> - <AppDomains> - <AppDomain>https://www.jabref.org</AppDomain> - </AppDomains> - <Hosts> - <Host Name="Document"/> - </Hosts> - <DefaultSettings> - <SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/> - </DefaultSettings> - <Permissions>ReadWriteDocument</Permissions> - <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0"> - <Hosts> - <Host xsi:type="Document"> - <DesktopFormFactor> - <GetStarted> - <Title resid="GetStarted.Title"/> - <Description resid="GetStarted.Description"/> - <LearnMoreUrl resid="GetStarted.LearnMoreUrl"/> - </GetStarted> - <FunctionFile resid="Commands.Url"/> - <ExtensionPoint xsi:type="PrimaryCommandSurface"> - <OfficeTab id="TabReferences"> - <Group id="CommandsGroup"> - <Label resid="CommandsGroup.Label"/> - <Icon> - <bt:Image size="16" resid="Icon.16x16"/> - <bt:Image size="32" resid="Icon.32x32"/> - <bt:Image size="80" resid="Icon.80x80"/> - </Icon> - <Control xsi:type="Button" id="TaskpaneButton"> - <Label resid="TaskpaneButton.Label"/> - <Supertip> - <Title resid="TaskpaneButton.Label"/> - <Description resid="TaskpaneButton.Tooltip"/> - </Supertip> - <Icon> - <bt:Image size="16" resid="Icon.16x16"/> - <bt:Image size="32" resid="Icon.32x32"/> - <bt:Image size="80" resid="Icon.80x80"/> - </Icon> - <Action xsi:type="ShowTaskpane"> - <TaskpaneId>ButtonId1</TaskpaneId> - <SourceLocation resid="Taskpane.Url"/> - </Action> - </Control> - </Group> - </OfficeTab> - </ExtensionPoint> - </DesktopFormFactor> - </Host> - </Hosts> - <Resources> - <bt:Images> - <bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/jabref-icon-16.png"/> - <bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/jabref-icon-32.png"/> - <bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/jabref-icon-80.png"/> - </bt:Images> - <bt:Urls> - <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/> - <bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/> - <bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/> - </bt:Urls> - <bt:ShortStrings> - <bt:String id="GetStarted.Title" DefaultValue="Get started with your sample add-in!"/> - <bt:String id="CommandsGroup.Label" DefaultValue="Commands Group"/> - <bt:String id="TaskpaneButton.Label" DefaultValue="JabRef"/> - </bt:ShortStrings> - <bt:LongStrings> - <bt:String id="GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started."/> - <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane"/> - </bt:LongStrings> - </Resources> - </VersionOverrides> -</OfficeApp> From 97ed4646b4317911d18700a3269f1e223202e557 Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 20:02:34 +0530 Subject: [PATCH 06/20] try without build command? --- .github/workflows/azure-static-web-apps-deploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index bb6993f9..3ad3422e 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -29,7 +29,6 @@ jobs: action: "upload" # App source code path app_location: "/" - app_build_command: "npm run build --env urlProd=$(jq --raw-output .pull_request.number '$GITHUB_EVENT_PATH')" # Built app content directory output_location: "dist" From ab86acbda5771a9151392aa3135f051710351c3d Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 21:57:37 +0530 Subject: [PATCH 07/20] TEst1 --- .github/workflows/azure-static-web-apps-deploy.yml | 3 +++ .vscode/extensions.json | 1 - webpack.config.js | 10 ++++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 3ad3422e..9bd6b691 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -14,6 +14,8 @@ jobs: if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') runs-on: ubuntu-latest name: Build and deploy + env: + URL_PROD: https://lively-ground-0d7c50410-$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH").centralus.azurestaticapps.net steps: - name: Checkout @@ -31,6 +33,7 @@ jobs: app_location: "/" # Built app content directory output_location: "dist" + app_build_command: "npm run build --env URL_PROD" cleanup_pull_request: if: github.event_name == 'pull_request' && github.event.action == 'closed' diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 2138d502..1a3ba278 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,7 +5,6 @@ // List of extensions which should be recommended for users of this workspace. "recommendations": [ "msjsdiag.debugger-for-chrome", - "msjsdiag.debugger-for-edge", "msoffice.microsoft-office-add-in-debugger", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode" diff --git a/webpack.config.js b/webpack.config.js index 3be506c9..a41442d2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,12 +6,10 @@ const HtmlWebpackPlugin = require("html-webpack-plugin"); const webpack = require("webpack"); var dotenv = require("dotenv").config({ path: __dirname + "/.env" }); -const urlDev = process.env.urlDev || "https://localhost:3000/"; -const prodUrl = "https://www.contoso.com/"; // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION - module.exports = async (env, options) => { const dev = options.mode === "development"; - const urlProd = env.urlProd || prodUrl; + const urlDev = process.env.urlDev || "https://localhost:3000"; + const urlProd = env.URL_PROD || "https://www.contoso.com"; const buildType = dev ? "dev" : "prod"; const config = { devtool: "source-map", @@ -59,6 +57,10 @@ module.exports = async (env, options) => { to: "taskpane.css", from: "./src/taskpane/taskpane.css", }, + { + from: "./assets", + to: "assets", + }, { to: "[name]." + buildType + ".[ext]", from: "manifest*.xml", From 3409dfcf7bdf7947ac9f5ec3a2ad60810d8bed1a Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 22:27:08 +0530 Subject: [PATCH 08/20] Test2 --- .github/workflows/azure-static-web-apps-deploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 9bd6b691..5c1c79b7 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -22,6 +22,7 @@ jobs: uses: actions/checkout@v2 with: submodules: true + - run: echo "🎉 The job was automatically triggered by a $URL_PROD event." - name: Build and deploy to Azure uses: Azure/static-web-apps-deploy@v1 @@ -33,7 +34,7 @@ jobs: app_location: "/" # Built app content directory output_location: "dist" - app_build_command: "npm run build --env URL_PROD" + app_build_command: "npm run build --env $URL_PROD" cleanup_pull_request: if: github.event_name == 'pull_request' && github.event.action == 'closed' From 91cf3c67070a4ba042655d5113342b627d938e9f Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 22:28:11 +0530 Subject: [PATCH 09/20] Test3 --- .github/workflows/azure-static-web-apps-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 5c1c79b7..9c5232d4 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -18,11 +18,11 @@ jobs: URL_PROD: https://lively-ground-0d7c50410-$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH").centralus.azurestaticapps.net steps: + - run: echo "🎉 The job was automatically triggered by a $URL_PROD event." - name: Checkout uses: actions/checkout@v2 with: submodules: true - - run: echo "🎉 The job was automatically triggered by a $URL_PROD event." - name: Build and deploy to Azure uses: Azure/static-web-apps-deploy@v1 From 48b9f63d9837ac0cd30f248f97f81f0efc14d400 Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 22:30:06 +0530 Subject: [PATCH 10/20] Test4 --- .github/workflows/azure-static-web-apps-deploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 9c5232d4..d7cc714c 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -15,7 +15,8 @@ jobs: runs-on: ubuntu-latest name: Build and deploy env: - URL_PROD: https://lively-ground-0d7c50410-$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH").centralus.azurestaticapps.net + PR: $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") + URL_PROD: https://lively-ground-0d7c50410-$PR.centralus.azurestaticapps.net steps: - run: echo "🎉 The job was automatically triggered by a $URL_PROD event." From 88d4f0b34db9e37742046d61580d6cee625e9542 Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 22:31:51 +0530 Subject: [PATCH 11/20] Test5 --- .github/workflows/azure-static-web-apps-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index d7cc714c..f5d899a5 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -16,7 +16,7 @@ jobs: name: Build and deploy env: PR: $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") - URL_PROD: https://lively-ground-0d7c50410-$PR.centralus.azurestaticapps.net + URL_PROD: https://lively-ground-0d7c50410-${{PR}}.centralus.azurestaticapps.net steps: - run: echo "🎉 The job was automatically triggered by a $URL_PROD event." From d71857eb65a767ec9029d20c5e672c79c720819e Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 22:32:44 +0530 Subject: [PATCH 12/20] Test 6 --- .github/workflows/azure-static-web-apps-deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index f5d899a5..e8864974 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -16,10 +16,9 @@ jobs: name: Build and deploy env: PR: $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") - URL_PROD: https://lively-ground-0d7c50410-${{PR}}.centralus.azurestaticapps.net steps: - - run: echo "🎉 The job was automatically triggered by a $URL_PROD event." + - run: echo "🎉 The job was automatically triggered by a $PR event." - name: Checkout uses: actions/checkout@v2 with: From 79c5bf061c925cd3dc8278131880e4603b4c5a41 Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 22:36:24 +0530 Subject: [PATCH 13/20] test 7 --- .github/workflows/azure-static-web-apps-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index e8864974..28cb9a1c 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -18,7 +18,7 @@ jobs: PR: $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") steps: - - run: echo "🎉 The job was automatically triggered by a $PR event." + - run: echo "🎉 The job was automatically triggered by a ${{github.event.number}} event." - name: Checkout uses: actions/checkout@v2 with: From 19f9ccacacf69b45c8b5476384d3adf9f94d4771 Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 22:39:49 +0530 Subject: [PATCH 14/20] Test 8 --- .github/workflows/azure-static-web-apps-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 28cb9a1c..4c796437 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -15,10 +15,10 @@ jobs: runs-on: ubuntu-latest name: Build and deploy env: - PR: $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") + URL_PROD: "https://lively-ground-0d7c50410-${{github.event.number}}.centralus.azurestaticapps.net" steps: - - run: echo "🎉 The job was automatically triggered by a ${{github.event.number}} event." + - run: echo "🎉 The job was automatically triggered by a $URL_PROD event." - name: Checkout uses: actions/checkout@v2 with: From 6c8290aed833510a0b493c83a999b9149a16679b Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 23:03:38 +0530 Subject: [PATCH 15/20] test comment bot --- .github/workflows/add-comment-bot.yml | 16 ++++++++++++++++ .../workflows/azure-static-web-apps-deploy.yml | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/add-comment-bot.yml diff --git a/.github/workflows/add-comment-bot.yml b/.github/workflows/add-comment-bot.yml new file mode 100644 index 00000000..aa172961 --- /dev/null +++ b/.github/workflows/add-comment-bot.yml @@ -0,0 +1,16 @@ +on: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: mshick/add-pr-comment@v1 + with: + message: | + **Hello** + 🌏 + ! + repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token-user-login: "github-actions[bot]" # The user.login for temporary GitHub tokens + allow-repeats: false # This is the default diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 9bd6b691..27e696ea 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest name: Build and deploy env: - URL_PROD: https://lively-ground-0d7c50410-$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH").centralus.azurestaticapps.net + URL_PROD: "https://lively-ground-0d7c50410-${{github.event.number}}.centralus.azurestaticapps.net" steps: - name: Checkout @@ -33,7 +33,7 @@ jobs: app_location: "/" # Built app content directory output_location: "dist" - app_build_command: "npm run build --env URL_PROD" + app_build_command: "npm run build --env $URL_PROD" cleanup_pull_request: if: github.event_name == 'pull_request' && github.event.action == 'closed' From 755057cf5121d97cc6df04f2c5819a12f4e91237 Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 23:06:28 +0530 Subject: [PATCH 16/20] update bot message --- .github/workflows/add-comment-bot.yml | 8 ++++---- .github/workflows/azure-static-web-apps-deploy.yml | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/add-comment-bot.yml b/.github/workflows/add-comment-bot.yml index aa172961..bc7c9641 100644 --- a/.github/workflows/add-comment-bot.yml +++ b/.github/workflows/add-comment-bot.yml @@ -4,13 +4,13 @@ on: jobs: test: runs-on: ubuntu-latest + env: + URL_PROD: "https://lively-ground-0d7c50410-${{github.event.number}}.centralus.azurestaticapps.net" steps: - uses: mshick/add-pr-comment@v1 with: message: | - **Hello** - 🌏 - ! + $URL_PROD repo-token: ${{ secrets.GITHUB_TOKEN }} - repo-token-user-login: "github-actions[bot]" # The user.login for temporary GitHub tokens + repo-token-user-login: "Bot[bot]" # The user.login for temporary GitHub tokens allow-repeats: false # This is the default diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 4c796437..27e696ea 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -18,7 +18,6 @@ jobs: URL_PROD: "https://lively-ground-0d7c50410-${{github.event.number}}.centralus.azurestaticapps.net" steps: - - run: echo "🎉 The job was automatically triggered by a $URL_PROD event." - name: Checkout uses: actions/checkout@v2 with: From b50584e8b12925d641572a19302cc732f9ed1e0d Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 23:44:25 +0530 Subject: [PATCH 17/20] add comment bot --- .github/workflows/add-comment-bot.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/add-comment-bot.yml b/.github/workflows/add-comment-bot.yml index bc7c9641..9017ef3a 100644 --- a/.github/workflows/add-comment-bot.yml +++ b/.github/workflows/add-comment-bot.yml @@ -1,16 +1,18 @@ +name: Comment Url + on: pull_request: jobs: test: runs-on: ubuntu-latest - env: - URL_PROD: "https://lively-ground-0d7c50410-${{github.event.number}}.centralus.azurestaticapps.net" steps: + - name: Checkout + uses: actions/checkout@v2 - uses: mshick/add-pr-comment@v1 with: message: | - $URL_PROD + https://lively-ground-0d7c50410-${{github.event.number}}.centralus.azurestaticapps.net/manifest.prod.xml repo-token: ${{ secrets.GITHUB_TOKEN }} - repo-token-user-login: "Bot[bot]" # The user.login for temporary GitHub tokens - allow-repeats: false # This is the default + repo-token-user-login: "github-actions[bot]" # The user.login for temporary GitHub tokens + allow-repeats: true From 8c1dc338e5e8fdcc5ccea49485cb56ed764e8178 Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sat, 1 Jan 2022 23:53:21 +0530 Subject: [PATCH 18/20] fix build command --- .github/workflows/azure-static-web-apps-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 27e696ea..a91a8c3f 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -33,7 +33,7 @@ jobs: app_location: "/" # Built app content directory output_location: "dist" - app_build_command: "npm run build --env $URL_PROD" + app_build_command: "npm run build --env URL_PROD=$URL_PROD" cleanup_pull_request: if: github.event_name == 'pull_request' && github.event.action == 'closed' From 86ca472c53750d296e14e6498617c5bb7af98421 Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sun, 2 Jan 2022 00:02:37 +0530 Subject: [PATCH 19/20] fix build command --- .github/workflows/azure-static-web-apps-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index a91a8c3f..3f97aad9 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -33,7 +33,7 @@ jobs: app_location: "/" # Built app content directory output_location: "dist" - app_build_command: "npm run build --env URL_PROD=$URL_PROD" + app_build_command: "npm run build -- --env URL_PROD=$URL_PROD" cleanup_pull_request: if: github.event_name == 'pull_request' && github.event.action == 'closed' From d415f8708c587b4914089b0b63d706457a6340ea Mon Sep 17 00:00:00 2001 From: Mohit <62339705+mohit038@users.noreply.github.com> Date: Sun, 2 Jan 2022 17:20:34 +0530 Subject: [PATCH 20/20] start comment job after build_and_deploy --- .github/workflows/add-comment-bot.yml | 18 -------------- .../azure-static-web-apps-deploy.yml | 14 +++++++++++ .github/workflows/comment-bot.yml | 24 +++++++++++++++++++ 3 files changed, 38 insertions(+), 18 deletions(-) delete mode 100644 .github/workflows/add-comment-bot.yml create mode 100644 .github/workflows/comment-bot.yml diff --git a/.github/workflows/add-comment-bot.yml b/.github/workflows/add-comment-bot.yml deleted file mode 100644 index 9017ef3a..00000000 --- a/.github/workflows/add-comment-bot.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Comment Url - -on: - pull_request: - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - uses: mshick/add-pr-comment@v1 - with: - message: | - https://lively-ground-0d7c50410-${{github.event.number}}.centralus.azurestaticapps.net/manifest.prod.xml - repo-token: ${{ secrets.GITHUB_TOKEN }} - repo-token-user-login: "github-actions[bot]" # The user.login for temporary GitHub tokens - allow-repeats: true diff --git a/.github/workflows/azure-static-web-apps-deploy.yml b/.github/workflows/azure-static-web-apps-deploy.yml index 3f97aad9..d0c56e84 100644 --- a/.github/workflows/azure-static-web-apps-deploy.yml +++ b/.github/workflows/azure-static-web-apps-deploy.yml @@ -46,3 +46,17 @@ jobs: with: azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} action: "close" + + add-pr-comment: + needs: build_and_deploy + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - uses: mshick/add-pr-comment@v1 + with: + message: | + https://lively-ground-0d7c50410-${{github.event.number}}.centralus.azurestaticapps.net/manifest.prod.xml + repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token-user-login: "github-actions[bot]" # The user.login for temporary GitHub tokens + allow-repeats: false # Don't comment the same URL twice diff --git a/.github/workflows/comment-bot.yml b/.github/workflows/comment-bot.yml new file mode 100644 index 00000000..40ceff81 --- /dev/null +++ b/.github/workflows/comment-bot.yml @@ -0,0 +1,24 @@ +# name: Comment Manifest Url + +# on: +# push: +# branches: +# - main +# pull_request: +# types: [opened] +# branches: +# - main + +# jobs: +# test: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# - uses: mshick/add-pr-comment@v1 +# with: +# message: | +# https://lively-ground-0d7c50410-${{github.event.number}}.centralus.azurestaticapps.net/manifest.prod.xml +# repo-token: ${{ secrets.GITHUB_TOKEN }} +# repo-token-user-login: "github-actions[bot]" # The user.login for temporary GitHub tokens +# allow-repeats: false # Don't comment the same URL twice