Skip to content

Commit

Permalink
two dists for release
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmonisit committed Jan 27, 2024
1 parent 90a86c7 commit 4369f09
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
run: pnpm install

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

- name: Archive Production Build
run: zip -r dist.zip dist/
run: zip -r shrunk-dev-dist.zip shrunk-dev-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: dist.zip
files: shrunk-dev-dist.zip shrunk-prod-dist.zip
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 4369f09

Please sign in to comment.