Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
anirvinv committed Feb 20, 2024
2 parents 7a74398 + 757eec7 commit 00b92b5
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install

- name: Build
run: npm run build:shrunk-test && mv dist shrunk-test-dist && npm run build:shrunk-prod && mv dist shrunk-prod-dist

- name: Archive Production Build
run: zip -r shrunk-test-dist.zip shrunk-test-dist/ && zip -r shrunk-prod-dist.zip shrunk-prod-dist/

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
shrunk-test-dist.zip
shrunk-prod-dist.zip
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ Click [here](https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/sidelo
## Important Information

Side-loading only works for Windows machines.

`shrunk-dist-prod.zip` and `shrunk-dist-dev.zip` are distribution builds of this project that are built on every new tag creation (new release version. see `.github/workflows/ci.yml` for more details). They differ in their `manifest.xml` files: when grabbing assets, the base URL either becomes `go.rutgers.edu/outlook/assets` or `shrunk.rutgers.edu/outlook/assets`, where `shrunk.r.e` is the test instance of `go.rutgers.edu`.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"dev_server_port": 3000
},
"scripts": {
"build": "webpack --mode production",
"build:shrunk-test": "webpack --env urlProd=shrunk.rutgers.edu --mode production",
"build:shrunk-prod": "webpack --env urlProd=go.rutgers.edu --mode production",
"build:dev": "webpack --mode development",
"dev-server": "webpack serve --mode development",
"lint": "office-addin-lint check",
Expand Down
8 changes: 7 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");

const urlDev = "https://localhost:3000/";
const urlProd = "https://www.contoso.com/"; // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION

async function getHttpsOptions() {
const httpsOptions = await devCerts.getHttpsServerOptions();
Expand All @@ -14,6 +13,13 @@ async function getHttpsOptions() {

module.exports = async (env, options) => {
const dev = options.mode === "development";

if (!env.urlProd) {
throw new Error("urlProd is required");
}

const urlProd = env.urlProd;

const config = {
devtool: "source-map",
entry: {
Expand Down

0 comments on commit 00b92b5

Please sign in to comment.