Skip to content
This repository was archived by the owner on Nov 28, 2023. It is now read-only.

Add a build process #28

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build and Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/[email protected] # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false

- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
npm install
npm run build

- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: dist # The folder the action should deploy.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ bower_components
logs
OpenFinRVM.exe
OpenFin
build

local.json
local.json
static/local.json
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ This project seed includes the following [Platform API](https://openfin.co/platf

* Clone this repository
* Install the dependencies: `npm install`
* Start the live-server and launch the application: `npm start`
* Start the server and launch the application: `npm start`

**Advanced Usage:**

For users who would like to test features with a different OpenFin Runtime, configure your workspace as follows:

* Generate a local manifest file, _local.json_, with the specified Runtime version, e.g. canary: `npm start -- canary`
* Subsequent launches will automatically use _local.json_; delete this file to revert to _app.json_
* Generate a local manifest file, _./static/local.json_, with the specified Runtime version, e.g. canary: `npm run config -- canary`
* Subsequent launches will automatically use _./static/local.json_; delete this file to revert to _app.json_

## Understanding the code

Expand Down
32 changes: 0 additions & 32 deletions color-view.html

This file was deleted.

47 changes: 0 additions & 47 deletions js/snapshot-form.js

This file was deleted.

25 changes: 25 additions & 0 deletions localConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const fs = require('fs');

const appJson = 'static/app.json';
const oldLocalJson = 'local.json';
const localJson = 'static/local.json';

if (fs.existsSync(oldLocalJson)) {
console.log('Copying old local config to static dir.\n./local.json may now be deleted.')
const manifest = require(`./${appJson}`);
fs.writeFileSync(localJson, JSON.stringify(manifest, null, 4));

}

// If user supplied a version argument, create a new local.json file
if (process.argv.length > 2) {
console.log('writing local config');
const manifest = require(`./${appJson}`);
const runtimeVersion = process.argv[2];

manifest.runtime.version = runtimeVersion;
fs.writeFileSync(localJson, JSON.stringify(manifest, null, 4));
}

// If local.json exists, use it instead of app.json
const manifestFile = fs.existsSync(localJson) ? localJson : appJson;
Loading