Skip to content

Commit

Permalink
Merge pull request #173 from TokenScript/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
nicktaras authored Feb 23, 2023
2 parents 59c3c9c + 388b69f commit f14b1fc
Show file tree
Hide file tree
Showing 333 changed files with 94,605 additions and 56,606 deletions.
29 changes: 12 additions & 17 deletions .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build examples
#description: Build all examples

on:
pull_request:
Expand Down Expand Up @@ -32,11 +33,15 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
registry-url: 'https://npm.pkg.github.com'

- name: Build
run: |
echo "Github base ref: $GITHUB_BASE_REF"
echo "Requested branch: $NEGOTIATOR_BRANCH"
npm install
if [[ $GITHUB_BASE_REF == "staging" ]]; then
echo "This is a staging branch PR, updating package.json files to use negotiator staging branch"
scripts/use_negotiator_branch.js staging
Expand All @@ -45,24 +50,14 @@ jobs:
echo "Negotiator branch $NEGOTIATOR_BRANCH requested, updating package.json files"
scripts/use_negotiator_branch.js $NEGOTIATOR_BRANCH
fi
npm run install-angular-bare-bones-demo
npm run install-art-gallery-medium-article-website
npm run install-vue-boilerplate
npm run build-angular-bare-bones-demo
npm run build-art-gallery-medium-article-website
npm run build-vue-boilerplate
npm install
npm run build
npm run install-barebones
npm run build-barebones
npm run install-ecommerce
export BASE_PATH=/token-negotiator-examples/ecommerce-store-website
npm run build-ecommerce
export MAX_PROCESSES=5
npm run install-examples
npm run clean
npm run build
npm run copy-artifacts
env:
NEGOTIATOR_BRANCH: ${{ inputs.negotiatorBranch }}

- uses: actions/upload-artifact@v3
with:
name: build
path: build
NODE_AUTH_TOKEN: ${{ github.token }}
27 changes: 14 additions & 13 deletions .github/workflows/deploy-to-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build & Deploy to gh-pages branch
name: Build & Deploy Examples To Staging
#description: Deploys examples to Github pages staging environment

on:
workflow_dispatch:
Expand Down Expand Up @@ -33,30 +34,29 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "**/package-lock.json"
registry-url: 'https://npm.pkg.github.com'

- name: Build
run: |
npm install
if [[ "${GITHUB_EVENT_NAME}" = push ]]; then
NEGOTIATOR_BRANCH="${GITHUB_REF_NAME}"
fi
if [[ ! -z $NEGOTIATOR_BRANCH && $NEGOTIATOR_BRANCH != "none" ]]; then
echo "Negotiator branch $NEGOTIATOR_BRANCH requested, updating package.json files"
scripts/use_negotiator_branch.js $NEGOTIATOR_BRANCH
fi
npm run install-angular-bare-bones-demo
npm run install-art-gallery-medium-article-website
npm run install-vue-boilerplate
npm install
npm run build-angular-bare-bones-demo
npm run build-art-gallery-medium-article-website
npm run build-vue-boilerplate
npm run build
npm run install-barebones
npm run build-barebones
npm run install-ecommerce
export BASE_PATH=/token-negotiator-examples/ecommerce-store-website
npm run build-ecommerce
export MAX_PROCESSES=5
npm run install-examples
npm run clean
npm run build
npm run copy-artifacts
short_sha="${GITHUB_SHA:0:7}"
build_version="${GITHUB_REF_NAME}-${short_sha}"
build_time="$(date --utc --iso-8601=seconds)"
Expand All @@ -65,6 +65,7 @@ jobs:
sed -i "s/<head>/<head><meta name=\"build-version\" content=\"${build_version}\"><meta name=\"build-time\" content=\"${build_time}\">/"
env:
NEGOTIATOR_BRANCH: ${{ inputs.negotiatorBranch }}
NODE_AUTH_TOKEN: ${{ github.token }}

- uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ecommerce-store-website.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build & Deploy ecommerce examples
name: Build & Deploy Ecommerce Production
#descriptions: Deploys the ecommerce demo to the production environment

on:
workflow_dispatch:
Expand Down Expand Up @@ -29,7 +30,6 @@ jobs:
npm ci
export BASE_PATH=/demo
npm run build
npx next export
short_sha="${GITHUB_SHA:0:7}"
build_version="${GITHUB_REF_NAME}-${short_sha}"
build_time="$(date --utc --iso-8601=seconds)"
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/token-outlet-website.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build & Deploy Token Outlet Website
#description: Deploys the token outlet demo website. Deploys to test environment from staging branch and production from main.

on:
workflow_dispatch:
Expand Down Expand Up @@ -29,6 +30,7 @@ jobs:
node-version: 16
cache: "npm"
cache-dependency-path: token-outlet-website/package-lock.json
registry-url: 'https://npm.pkg.github.com'
- run: |
echo -n "Node version: "
node -v
Expand All @@ -37,17 +39,22 @@ jobs:
- name: building
env:
NEGOTIATOR_BRANCH: ${{ inputs.negotiatorBranch }}
NODE_AUTH_TOKEN: ${{ github.token }}
run: |
npm install
if [[ "${GITHUB_EVENT_NAME}" = push ]]; then
NEGOTIATOR_BRANCH="${GITHUB_REF_NAME}"
fi
if [[ ! -z $NEGOTIATOR_BRANCH && $NEGOTIATOR_BRANCH != "none" ]]; then
echo "Negotiator branch $NEGOTIATOR_BRANCH requested, updating package.json files"
scripts/use_negotiator_branch.js $NEGOTIATOR_BRANCH
scripts/use_negotiator_branch.js $NEGOTIATOR_BRANCH token-outlet-website
fi
cd token-outlet-website
npm install
npm run build
short_sha="${GITHUB_SHA:0:7}"
build_version="${GITHUB_REF_NAME}-${short_sha}"
build_time="$(date --utc --iso-8601=seconds)"
Expand Down
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,38 @@ See the README's inside each example for configuration and deployment.
## Running the examples via localhost

- cd into the root of this directory
- run `npm run install` to install all dependancies for the examples
- run `npm install` to install all dependancies for the examples
- run `npm run start` which will serve all examples with a single command
- Or alternatively, serve each example seperately (see readme inside each directory for more information)

there are also other batch commands supported

- run `npm run link/unlink` to link/unlink local `token-negotiator` with the example, local `token-negotiator` needs to sit in the same directory as this repo
- run `npm run build` to build all the examples
- run `npm run start-on-chain` which will serve all on-chain examples
- run `npm run start-off-chain` which will serve all off-chain examples

all the above batch commands support specifying individual examples as the target, e.g.

- run `EXAMPLES=art-gallery-medium-article-website npm run start` to start the specified example
- run `EXAMPLES=art-gallery-medium-article-website,ecommerce-store-website npm run build` to build multiple examples at the same time (examples are comma separated)

Notes:

- to manage examples recognized by the batch commands, please update `examples.json` accordingly.
- in order to make sure all the dev servers can run at the same time, you need to avoid port conflict, here are all the existing examples and the port in use, please update whenever you make a change
- angular-bare-bones-demo: 4200
- art-gallery-medium-article-website: 3003
- ecommerce-store-website: 3004
- svelte-demo: 8080
- typescript-bare-bones-demo: 3010
- vue-boilerplate: 8081
- vue-vite-boilerplate: 5173
- hotel-bogota-active-negotiation-website: 3000
- hotel-bogota-passive-negotiation-website: 3001
- ticket-issuer-url-website: 3005
- token-outlet-website: 3002

## Library Documentation

https://github.com/TokenScript/token-negotiator
Expand Down
1 change: 1 addition & 0 deletions angular-bare-bones-demo/dist/110.a397f78a35145eea.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion angular-bare-bones-demo/dist/261.1843d3d0c204dc4b.js

This file was deleted.

1 change: 0 additions & 1 deletion angular-bare-bones-demo/dist/342.4df90bc687b84f92.js

This file was deleted.

Loading

0 comments on commit f14b1fc

Please sign in to comment.