Skip to content
Merged
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
92 changes: 92 additions & 0 deletions .github/workflows/archive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Archive the source

on:
workflow_dispatch

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: write
packages: read

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: WISE-Developers/WISE_Versions
path: versions
token: ${{ secrets.WISE_PAT }}
- uses: actions/checkout@v3
with:
repository: WISE-Developers/wise_docs
path: wise_docs
token: ${{ secrets.WISE_PAT }}

- name: Load values from versions
id: version-numbers
shell: pwsh
run: |
$versions = ConvertFrom-StringData (Get-Content versions/versions.properties -raw)
echo "Updating to version $($versions.wise)"
echo "wise_version=$($versions.wise)" >> $env:GITHUB_OUTPUT

- name: Archive files
shell: pwsh
run: |
Compress-Archive -DestinationPath ${{ steps.version-numbers.outputs.wise_version }}.zip -Path dist,proto,scripts,config,index.js,index.d.ts,package.json,package-lock.json,LICENSE

- name: Archive files
run: |
cd src
npm run docs
cd ../wise_docs
rm -rf wise_js
mv ../src/nodedocs wise_js
git config user.name github-actions
git config user.email github-actions@github.com
git add *
git commit * -m "Update JavaScript documentation"

- name: Push documentation changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.WISE_PAT }}
repository: WISE-Developers/wise_docs
directory: wise_docs
tags: true

- name: Tag the repository
id: last-tags
run: |
git config user.name github-actions
git config user.email github-actions@github.com
LAST_TAG=$(git describe --abbrev=0 --tags)
echo "last_tag=$LAST_TAG" >> $GITHUB_OUTPUT
git tag -a ${{ steps.version-numbers.outputs.wise_version }} -m "W.I.S.E. JS API release on $(date +'%Y-%m-%d')"

- name: Push versions changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.WISE_PAT }}
tags: true

- name: Create API Release Notes
id: builder-notes
uses: mikepenz/release-changelog-builder-action@v3.5.0
with:
owner: WISE-Developers
repo: WISE_JS_API
toTag: ${{ steps.version-numbers.outputs.wise_version }}
fromTag: ${{ steps.last-tags.outputs.last_tag }}
env:
GITHUB_TOKEN: ${{ secrets.WISE_PAT }}

- name: Create release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.version-numbers.outputs.wise_version }}
body: ${{ steps.builder-notes.outputs.changelog }}
files: ./*.zip
tag_name: refs/tags/${{ steps.version-numbers.outputs.wise_version }}
30 changes: 13 additions & 17 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
This is documentation for the Node.JS version of the PSaaS API.
This is documentation for the Node.JS version of the W.I.S.E. API.

## Main Modules

The API is split up into several modules.

### client.js

This module contains the client API needed to listen for events raised by running PSaaS jobs using MQTT.
This module contains the client API needed to listen for events raised by running W.I.S.E. jobs using MQTT.

### defaults.js

This module loads default values from PSaaS Builder for the few simulation parameters that have defaults.
This module loads default values from W.I.S.E. Builder for the few simulation parameters that have defaults.

### fbp.js

A module to run FBP calculations from PSaaS Builder.
A module to run FBP calculations from W.I.S.E. Builder.

### forecast.js

Request PSaaS Builder to lookup forecast information from Environment Canada. This module also provides methods to fetch the cities that support forecast lookups.
Request W.I.S.E. Builder to lookup forecast information from Environment Canada. This module also provides methods to fetch the cities that support forecast lookups.

### fwi.js

A module to run FWI calculations from PSaaS Builder.
A module to run FWI calculations from W.I.S.E. Builder.

### index.js

An example web server that uses all other modules. It displays a basic website with a static FWI calculation example, forms for doing FBP and solar calculations, forecast and current condition weather lookups, and a simple start PSaaS job function. The start job function will display statistic results from the running job as they are emitted.
An example web server that uses all other modules. It displays a basic website with a static FWI calculation example, forms for doing FBP and solar calculations, forecast and current condition weather lookups, and a simple start W.I.S.E. job function. The start job function will display statistic results from the running job as they are emitted.

### psaasGlobals.js
### wiseGlobals.js

Global classes needed for interacting with various parts of the PSaaS network.
Global classes needed for interacting with various parts of the W.I.S.E. network.

### psaasInterface.js
### wiseInterface.js

Classes needed for building and running PSaaS jobs. Simulations are built and PSaaS Builder is triggered to create the job for PSaaS to run.
Classes needed for building and running W.I.S.E. jobs. Simulations are built and W.I.S.E. Builder is triggered to create the job for W.I.S.E. to run.

### solar.js

A module to run solar calculations (sunrise, sunset, solar noon) from PSaaS Builder.
A module to run solar calculations (sunrise, sunset, solar noon) from W.I.S.E. Builder.

### weather.js

A module to lookup current weather conditions with PSaaS Builder. The module also contains methods to lookup the cities that support current weather conditions.
A module to lookup current weather conditions with W.I.S.E. Builder. The module also contains methods to lookup the cities that support current weather conditions.

## Dependencies

Expand All @@ -53,7 +53,3 @@ A module to lookup current weather conditions with PSaaS Builder. The module als
- socket.io
- protobufjs
- npm-conf

## Installation Details

Package installation and usage can be found in the repository on [Bitbucket](https://bitbucket.org/psaasredapp/psaas-js-api).