diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 41b352b4..f430613d 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -46,7 +46,7 @@ jobs: git add CHANGELOG.md sed -i -e '//d' CHANGELOG.md git commit -m "Updating changelog for $version" - git tag $version -m "Release $version \n$changes" + git tag $version -m "Release $version $changes" git push origin $version git push origin main fi diff --git a/.github/workflows/build-installers.yaml b/.github/workflows/build-installers.yaml index 1bd02058..9298f3b9 100644 --- a/.github/workflows/build-installers.yaml +++ b/.github/workflows/build-installers.yaml @@ -1,228 +1,241 @@ -name: Build & Release - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }} - cancel-in-progress: true - -jobs: - build_mac: - name: Build Mac Installer - runs-on: macos-latest - steps: - - uses: Chia-Network/actions/clean-workspace@main - - - name: Checkout Code - uses: actions/checkout@v3 - - - name: Setup Node 18.16 - uses: actions/setup-node@v3 - with: - node-version: '18.16' - - - name: Install Husky - run: npm install --save-dev husky - - - name: install dmg-license - run: npm i dmg-license - - - name: npm install - run: | - node --version - npm install - - - name: Import Apple installer signing certificate - uses: Apple-Actions/import-codesign-certs@v1 - with: - p12-file-base64: ${{ secrets.APPLE_DEV_ID_APP }} - p12-password: ${{ secrets.APPLE_DEV_ID_APP_PASS }} - - - name: Build electron app - env: - CSC_FOR_PULL_REQUEST: "true" - run: npm run electron:package:mac - - - name: Notarize - run: | - DMG_FILE=$(find ${{ github.workspace }}/dist/ -type f -name '*.dmg') - npm install -g notarize-cli - notarize-cli \ - --file="$DMG_FILE" \ - --bundle-id net.chia.cadt-ui \ - --username "${{ secrets.APPLE_NOTARIZE_USERNAME }}" \ - --password "${{ secrets.APPLE_NOTARIZE_PASSWORD }}" - - - name: Upload Mac Installer - uses: actions/upload-artifact@v3 - with: - name: cadt-ui-mac-installer - path: ${{ github.workspace }}/dist/*.dmg - - build_windows: - name: Build Windows Installer - runs-on: windows-2019 - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - - name: Setup Node 18.16 - uses: actions/setup-node@v3 - with: - node-version: '18.16' - - - name: Install Husky - run: npm install --save-dev husky - - - name: Ignore Husky where not compatible - run: npm pkg delete scripts.prepare - - - name: npm install - run: | - node --version - npm install - - - name: Build electron app - env: - CSC_LINK: ${{ secrets.WIN_CODE_SIGN_CERT }} - CSC_KEY_PASSWORD: ${{ secrets.WIN_CODE_SIGN_PASSWORD }} - run: npm run electron:package:win - - - name: Upload Windows Installer - uses: actions/upload-artifact@v3 - with: - name: cadt-ui-windows-installer - path: ${{ github.workspace }}/dist/*.exe - - build_linux: - name: Build Linux Installer - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - - name: Setup Node 18.16 - uses: actions/setup-node@v3 - with: - node-version: '18.16' - - - name: Install Husky - run: npm install --save-dev husky - - - name: npm install - run: | - node --version - npm install - - - name: Build electron app - run: npm run electron:package:linux - - - name: Rename Linux installer to be standard format for apt - run: | - ORIGINAL=$(ls dist/*.deb) - MODIFIED=${ORIGINAL:0:-10}-1${ORIGINAL#${ORIGINAL:0:-10}} - mv $ORIGINAL $MODIFIED - - - name: Upload Linux Installer - uses: actions/upload-artifact@v3 - with: - name: cadt-ui-linux-installer - path: ${{ github.workspace }}/dist/*.deb - - build_web: - name: Build CADT UI Web App - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - - name: Setup Node 18.16 - uses: actions/setup-node@v3 - with: - node-version: '18.16' - - - name: Install Husky - run: npm install --save-dev husky - - - name: npm install and build - run: | - node --version - npm install - npm run build - - - name: Create .tar.gz of the web build - run: tar -cvzf cadt-ui-web-build.tar.gz build - - - name: Upload build artifact - uses: actions/upload-artifact@v3 - with: - name: cadt-ui-web-build - path: cadt-ui-web-build.tar.gz - - release: - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') - needs: - - build_mac - - build_windows - - build_linux - - build_web - steps: - - name: Download Windows artifacts - uses: actions/download-artifact@v3 - with: - name: cadt-ui-windows-installer - path: cadt-ui-windows-installer - - - name: Download MacOS artifacts - uses: actions/download-artifact@v3 - with: - name: cadt-ui-mac-installer - path: cadt-ui-mac-installer - - - name: Download Linux artifacts - uses: actions/download-artifact@v3 - with: - name: cadt-ui-linux-installer - path: cadt-ui-linux-installer - - - name: Download Web artifact - uses: actions/download-artifact@v3 - with: - name: cadt-ui-web-build - path: cadt-ui-web-build - - - name: Get Filenames - run: | - DMG_FILE=$(find ${{ github.workspace }}/cadt-ui-mac-installer/ -type f -name '*.dmg') - DEB_FILE=$(find ${{ github.workspace }}/cadt-ui-linux-installer/ -type f -name '*.deb') - EXE_FILE=$(find ${{ github.workspace }}/cadt-ui-windows-installer/ -type f -name '*.exe') - WEB_FILE=$(find ${{ github.workspace }}/cadt-ui-web-build/ -type f -name '*.tar.gz') - - echo "DMG_FILE=$DMG_FILE" >>$GITHUB_ENV - echo "DEB_FILE=$DEB_FILE" >>$GITHUB_ENV - echo "EXE_FILE=$EXE_FILE" >>$GITHUB_ENV - echo "WEB_FILE=$WEB_FILE" >>$GITHUB_ENV - - - name: Release - uses: softprops/action-gh-release@v0.1.15 - with: - files: | - ${{ env.DMG_FILE }} - ${{ env.DEB_FILE }} - ${{ env.EXE_FILE }} - ${{ env.WEB_FILE }} - - - name: Trigger apt repo update - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"cadt_repo":"cadt-ui","release_version":"${{ steps.tag-name.outputs.TAGNAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/cadt/${{ github.sha }}/start - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"cadt_repo":"cadt-ui","release_version":"${{ steps.tag-name.outputs.TAGNAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/cadt/${{ github.sha }}/success/deploy +name: Build & Release + +on: + push: + branches: + - main + tags: + - '**' + pull_request: + branches: + - '**' + +concurrency: + # SHA is added to the end if on `main` to let all main workflows run + group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }} + cancel-in-progress: true + +jobs: + build_mac: + name: Build Mac Installer + runs-on: macos-latest + steps: + - uses: Chia-Network/actions/clean-workspace@main + + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Node 18.16 + uses: actions/setup-node@v3 + with: + node-version: '18.16' + + - name: Install Husky + run: npm install --save-dev husky + + - name: install dmg-license + run: npm i dmg-license + + - name: npm install + run: | + npm install + + - name: Import Apple installer signing certificate + uses: Apple-Actions/import-codesign-certs@v1 + with: + p12-file-base64: ${{ secrets.APPLE_DEV_ID_APP }} + p12-password: ${{ secrets.APPLE_DEV_ID_APP_PASS }} + + - name: Build electron app + env: + CSC_FOR_PULL_REQUEST: "true" + run: npm run electron:package:mac + + - name: Notarize + run: | + DMG_FILE=$(find ${{ github.workspace }}/dist/ -type f -name '*.dmg') + npm install -g notarize-cli + notarize-cli \ + --file="$DMG_FILE" \ + --bundle-id net.chia.cadt-ui \ + --username "${{ secrets.APPLE_NOTARIZE_USERNAME }}" \ + --password "${{ secrets.APPLE_NOTARIZE_PASSWORD }}" + + - name: Upload Mac Installer + uses: actions/upload-artifact@v3 + with: + name: cadt-ui-mac-installer + path: ${{ github.workspace }}/dist/*.dmg + + build_windows: + name: Build Windows Installer + runs-on: windows-2019 + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Node 18.16 + uses: actions/setup-node@v3 + with: + node-version: '18.16' + + - name: Install Husky + run: npm install --save-dev husky + + - name: Ignore Husky where not compatible + run: npm pkg delete scripts.prepare + + - name: npm install + run: | + node --version + npm install + + - name: Build electron app + run: npm run electron:package:win + + # Windows Code Signing + - name: Get installer name for signing + shell: bash + run: | + FILE=$(find dist -type f -maxdepth 1 -name '*.exe') + echo "Installer file is $FILE" + echo "INSTALLER_FILE=$FILE" >> "$GITHUB_ENV" + + - name: Sign windows artifacts + uses: chia-network/actions/digicert/windows-sign@main + with: + sm_api_key: ${{ secrets.SM_API_KEY }} + sm_client_cert_file_b64: ${{ secrets.SM_CLIENT_CERT_FILE_B64 }} + sm_client_cert_password: ${{ secrets.SM_CLIENT_CERT_PASSWORD }} + sm_code_signing_cert_sha1_hash: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }} + file: "${{ github.workspace }}/${{ env.INSTALLER_FILE }}" + + - name: Upload Windows Installer + uses: actions/upload-artifact@v3 + with: + name: cadt-ui-windows-installer + path: "${{ github.workspace }}/${{ env.INSTALLER_FILE }}" + + build_linux: + name: Build Linux Installer + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Node 18.16 + uses: actions/setup-node@v3 + with: + node-version: '18.16' + + - name: Install Husky + run: npm install --save-dev husky + + - name: npm install + run: | + node --version + npm install + + - name: Build electron app + run: npm run electron:package:linux + + - name: Rename Linux installer to be standard format for apt + run: | + ORIGINAL=$(ls dist/*.deb) + MODIFIED=${ORIGINAL:0:-10}-1${ORIGINAL#${ORIGINAL:0:-10}} + mv $ORIGINAL $MODIFIED + + - name: Upload Linux Installer + uses: actions/upload-artifact@v3 + with: + name: cadt-ui-linux-installer + path: ${{ github.workspace }}/dist/*.deb + + build_web: + name: Build CADT UI Web App + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Node 18.16 + uses: actions/setup-node@v3 + with: + node-version: '18.16' + + - name: Install Husky + run: npm install --save-dev husky + + - name: npm install and build + run: | + node --version + npm install + npm run build + + - name: Create .tar.gz of the web build + run: tar -cvzf cadt-ui-web-build.tar.gz build + + - name: Upload build artifact + uses: actions/upload-artifact@v3 + with: + name: cadt-ui-web-build + path: cadt-ui-web-build.tar.gz + + release: + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + needs: + - build_mac + - build_windows + - build_linux + - build_web + steps: + - name: Download Windows artifacts + uses: actions/download-artifact@v3 + with: + name: cadt-ui-windows-installer + path: cadt-ui-windows-installer + + - name: Download MacOS artifacts + uses: actions/download-artifact@v3 + with: + name: cadt-ui-mac-installer + path: cadt-ui-mac-installer + + - name: Download Linux artifacts + uses: actions/download-artifact@v3 + with: + name: cadt-ui-linux-installer + path: cadt-ui-linux-installer + + - name: Download Web artifact + uses: actions/download-artifact@v3 + with: + name: cadt-ui-web-build + path: cadt-ui-web-build + + - name: Get Filenames + run: | + DMG_FILE=$(find ${{ github.workspace }}/cadt-ui-mac-installer/ -type f -name '*.dmg') + DEB_FILE=$(find ${{ github.workspace }}/cadt-ui-linux-installer/ -type f -name '*.deb') + EXE_FILE=$(find ${{ github.workspace }}/cadt-ui-windows-installer/ -type f -name '*.exe') + WEB_FILE=$(find ${{ github.workspace }}/cadt-ui-web-build/ -type f -name '*.tar.gz') + + echo "DMG_FILE=$DMG_FILE" >>$GITHUB_ENV + echo "DEB_FILE=$DEB_FILE" >>$GITHUB_ENV + echo "EXE_FILE=$EXE_FILE" >>$GITHUB_ENV + echo "WEB_FILE=$WEB_FILE" >>$GITHUB_ENV + + - name: Release + uses: softprops/action-gh-release@v0.1.15 + with: + files: | + ${{ env.DMG_FILE }} + ${{ env.DEB_FILE }} + ${{ env.EXE_FILE }} + ${{ env.WEB_FILE }} + + - name: Trigger apt repo update + run: | + curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"cadt_repo":"cadt-ui","release_version":"${{ steps.tag-name.outputs.TAGNAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/cadt/${{ github.sha }}/start + curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"cadt_repo":"cadt-ui","release_version":"${{ steps.tag-name.outputs.TAGNAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/cadt/${{ github.sha }}/success/deploy diff --git a/LICENSE b/LICENSE index 4e5b4fab..025f1343 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2022 Chia Network Inc. +Copyright 2023 Chia Network Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -8,9 +8,9 @@ http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and limitations under the License. - - +See the License for the specific language governing permissions and limitations under the License. + + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/README.md b/README.md index 8ee2f6ec..1e01cc1d 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ sudo apt-get install cadt-ui ### Web Application -The Climate Warehouse UI can be hosted as a web application, either for internal use, or made available to the public. When operating as a web application, the user's browser must be able to connect to the [CADT API](https://github.com/Chia-Network/cadt). This means the API must be available on the public internet if the UI is public. The `READ_ONLY` option on the API should be set when running a public observer node. +The CADT UI can be hosted as a web application, either for internal use, or made available to the public. When operating as a web application, the user's browser must be able to connect to the [CADT API](https://github.com/Chia-Network/cadt). This means the API must be available on the public internet if the UI is public. The `READ_ONLY` option on the API should be set when running a public observer node. To host the UI on the web, use the [web-build.tar.gz file from the releases page](https://github.com/Chia-Network/cadt-ui/releases). One of the simplest solutions is to uncompress these files into a [public S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteAccessPermissionsReqd.html). These files could also be served by any webserver, such as Nginx or Apache. @@ -55,7 +55,7 @@ To host the UI on the web, use the [web-build.tar.gz file from the releases page ``` npm install -g react-scripts git clone git@github.com:Chia-Network/cadt-ui.git -cd climate-warehouse-ui +cd cadt-ui nvm install 18.16.0 nvm use 18.16.0 npm install foreman -g diff --git a/package.json b/package.json index cd1c8f19..5fa74f20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cadt-ui", - "version": "1.2.4", + "version": "1.2.5", "private": true, "author": "Chia Network Inc. ", "homepage": "./",