Skip to content

Commit

Permalink
Merge branch 'main' into feat-detokanize-amount-on-warehouse
Browse files Browse the repository at this point in the history
  • Loading branch information
danielstefanequilobe committed Nov 11, 2022
2 parents 0829974 + 00735e8 commit 68c972e
Show file tree
Hide file tree
Showing 17 changed files with 886 additions and 34 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Compares the version in package.json to tags on the repo. If the tag doesn't exist, a new tag is created, which
# then triggers the normal "on tag" release automation in the build job
name: Auto Tag

on:
push:
branches:
- main

concurrency:
group: main-release-check

jobs:
check-version:
name: Check version increment
runs-on: ubuntu-latest
steps:
- uses: Chia-Network/actions/clean-workspace@main

- name: Checkout current branch
uses: actions/checkout@v3
with:
# Need PACKAGE_ADMIN_PAT token so when the tag is created, the tag automation runs
token: ${{ secrets.PACKAGE_ADMIN_PAT }}
fetch-depth: 0

- name: Check for current version tag. Create if it doesn't exist
run: |
version=$(cat $GITHUB_WORKSPACE/package.json | jq -r '.version')
echo "Version is: $version"
if [ $(git tag -l "$version") ]; then
echo "Tag exists, nothing to do"
else
echo "Tag does not exist. Creating and pushing tag"
rm -f CHANGELOG.md
npx conventional-changelog-cli -p angular -i CHANGELOG.md -s -r 0
git add CHANGELOG.md
git config --global user.name 'ChiaAutomation'
git config --global user.email '[email protected]'
git commit -m "Updating changelog for $version"
git tag $version
git push origin $version
git push origin main
fi
200 changes: 200 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
name: Build Binaries

on:
push:
branches:
- main
tags:
- '**'
pull_request:
branches:
- '**'

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
build:
name: Build Binaries
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
include:
- runs-on: ubuntu-latest
artifact-name: linux-x64
build-command: npm run create-linux-x64-dist
- runs-on: macos-latest
artifact-name: macos-x64
build-command: npm run create-mac-x64-dist
- runs-on: windows-2019
artifact-name: windows-x64
build-command: npm run create-win-x64-dist

steps:
- uses: Chia-Network/actions/clean-workspace@main

- name: Checkout Code
uses: actions/checkout@v2

- name: Setup Node 16.x
uses: actions/[email protected]
with:
node-version: '16.0.0'

- name: Ignore Husky
run: npm set-script prepare ""
if: matrix.runs-on != 'windows-2019'

- name: npm install
run: |
node --version
npm install
- name: npm cache clear --force
run: npm cache clear --force

- name: npm cache rm
run: npm cache rm --force

- name: npm cache verify
run: npm cache verify

- name: install global packages
run: npm i -g @babel/cli @babel/preset-env pkg

- name: create distributions
run: ${{ matrix.build-command }}

- name: Make executable
run: chmod +x dist/climate-portal

### If using sqlite, uncomment the following 2 sections ###
### and add a line to sign the sqlite binaries in the ###
### Mac section. ###

# - name: Copy sqlite3 (non windows)
# run: cp ./node_modules/sqlite3/build/Release/node_sqlite3.node ./dist/
# if: matrix.runs-on != 'windows-2019'

# - name: Copy sqlite3 (windows)
# run: cp .\node_modules\sqlite3\build\Release\node_sqlite3.node .\dist\
# if: matrix.runs-on == 'windows-2019'

# Windows Code Signing
- name: Decode code signing cert into an encrypted file
if: matrix.runs-on == 'windows-2019'
uses: kitek/[email protected]
with:
encoded-value: ${{ secrets.WIN_CODE_SIGN_CERT }}
destination-file: .\win_code_sign_cert.pfx

- name: Sign windows artifacts
if: matrix.runs-on == 'windows-2019'
uses: chia-network/actions/sign/windows@main
with:
certificate_path: .\win_code_sign_cert.pfx
certificate_password: ${{ secrets.WIN_CODE_SIGN_PASSWORD }}
file: ${{ github.workspace }}/dist/climate-portal.exe

# Mac .pkg build + sign
- name: Import Apple installer signing certificate
#if: steps.check_secrets.outputs.HAS_SECRET
if: matrix.runs-on == 'macos-latest'
uses: Apple-Actions/import-codesign-certs@v1
with:
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }}
p12-file-base64: ${{ secrets.APPLE_DEV_ID_INSTALLER }}
p12-password: ${{ secrets.APPLE_DEV_ID_INSTALLER_PASS }}

- name: Import Apple Application signing certificate
#if: steps.check_secrets.outputs.HAS_SECRET
if: matrix.runs-on == 'macos-latest'
uses: Apple-Actions/import-codesign-certs@v1
with:
create-keychain: false # Created when importing the first cert
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }}
p12-file-base64: ${{ secrets.APPLE_DEV_ID_APP }}
p12-password: ${{ secrets.APPLE_DEV_ID_APP_PASS }}

- name: Build Mac .pkg
if: matrix.runs-on == 'macos-latest'
run: |
rm -rf ${{ github.workspace }}/build-scripts/macos/darwin/application || true
cp -r ${{ github.workspace }}/dist ${{ github.workspace }}/build-scripts/macos/application
echo "Signing the binaries"
codesign -f -s "Developer ID Application: Chia Network Inc." --timestamp --options=runtime --entitlements ${{ github.workspace }}/build-scripts/macos/entitlements.mac.plist ${{ github.workspace }}/build-scripts/macos/application/climate-portal
# Makes the .pkg in ./build-scripts/macos/target/pkg
echo "Building the .pkg"
bash ${{ github.workspace }}/build-scripts/macos/build-macos.sh ClimatePortal
mkdir -p ${{ github.workspace }}/build-scripts/macos/target/pkg-signed
echo "Signing the .pkg"
productsign --sign "Developer ID Installer: Chia Network Inc." ${{ github.workspace }}/build-scripts/macos/target/pkg/ClimatePortal-macos-installer-x64.pkg ${{ github.workspace }}/build-scripts/macos/target/pkg-signed/ClimatePortal-macos-installer-x64.pkg
echo "Notarizing the .pkg"
npm install -g notarize-cli
notarize-cli \
--file=${{ github.workspace }}/build-scripts/macos/target/pkg-signed/ClimatePortal-macos-installer-x64.pkg \
--bundle-id net.chia.climate-portal \
--username "${{ secrets.APPLE_NOTARIZE_USERNAME }}" \
--password "${{ secrets.APPLE_NOTARIZE_PASSWORD }}"
- name: Upload Mac Installer
if: matrix.runs-on == 'macos-latest'
uses: actions/upload-artifact@v2
with:
name: mac-installer
path: ${{ github.workspace }}/build-scripts/macos/target/pkg-signed

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact-name }}
path: ${{ github.workspace }}/dist

release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
steps:
- name: Download Windows artifacts
uses: actions/download-artifact@v2
with:
name: windows-x64
path: windows-x64

- name: Download MacOS artifacts
uses: actions/download-artifact@v2
with:
name: mac-installer
path: mac-installer

- name: Download Linux artifacts
uses: actions/download-artifact@v2
with:
name: linux-x64
path: linux-x64

- name: Get tag name
id: tag-name
run: |
echo ::set-output name=TAGNAME::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Create zips
run: |
zip -r windows-x64-${{ steps.tag-name.outputs.TAGNAME }}.zip windows-x64
zip -r macos-x64-${{ steps.tag-name.outputs.TAGNAME }}.zip mac-installer
zip -r linux-x64-${{ steps.tag-name.outputs.TAGNAME }}.zip linux-x64
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
windows-x64-${{ steps.tag-name.outputs.TAGNAME }}.zip
macos-x64-${{ steps.tag-name.outputs.TAGNAME }}.zip
linux-x64-${{ steps.tag-name.outputs.TAGNAME }}.zip
42 changes: 42 additions & 0 deletions .github/workflows/ensure-version-increment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow runs on any PRs that are targeting main, and ensures that the version in package.json is incremented
name: Check Version Increment

on:
pull_request:
branches:
- 'main'

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:
check-version:
name: Check version increment
runs-on: ubuntu-latest
steps:
- uses: Chia-Network/actions/clean-workspace@main

- name: Checkout current branch
uses: actions/checkout@v2
with:
path: branch-repo

- name: Checkout main
uses: actions/checkout@v2
with:
ref: main
path: main-repo

- name: Check Versions
run: |
main_version=$(cat $GITHUB_WORKSPACE/main-repo/package.json | jq -r '.version')
branch_version=$(cat $GITHUB_WORKSPACE/branch-repo/package.json | jq -r '.version')
echo "Main version: $main_version"
echo "Branch version: $branch_version"
if [[ "$branch_version" == "$main_version" ]]; then
echo "Version in package.json on this branch is not changing. Version must incremenet for a merge to main"
exit 1
fi
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## 1.0.1 (2022-11-11)


### Bug Fixes

* add orgUid to proxy requests ([5ef63c8](https://github.com/Chia-Network/Climate-Portal/commit/5ef63c85f84a1e6c441aabf87213a2de2583c86d))
* orguid update is not working ([3b8353d](https://github.com/Chia-Network/Climate-Portal/commit/3b8353de47075a5f44b1ba5193a5322e70292fad))
* tokenize validation ([fcb8072](https://github.com/Chia-Network/Climate-Portal/commit/fcb80727b4bf7e29be58130d67d4eea0a3e16e27))
* wallet holder ([14e85b4](https://github.com/Chia-Network/Climate-Portal/commit/14e85b4a476117133bffbd1b2117f7ee1b39392b))


### Features

* add default fee ([a5eb659](https://github.com/Chia-Network/Climate-Portal/commit/a5eb659ebbb16ac20eea5b58cecfd4ea5f0754cb))
* add hoi validation ([1ad37ce](https://github.com/Chia-Network/Climate-Portal/commit/1ad37ce0131c16f19f3a1d61a51b1549e81fbb80))
* add home org does not exist error ([889ad46](https://github.com/Chia-Network/Climate-Portal/commit/889ad46ea20482dee466eff24dff0bd0452b8545))
* add orguid header ([6c60392](https://github.com/Chia-Network/Climate-Portal/commit/6c6039281d9c86280611c80420a14a8498ecb874))
* add orgUid to all headers ([ea238f5](https://github.com/Chia-Network/Climate-Portal/commit/ea238f5afb881823eb8b0c14b739676cf8056b17))
* add pagination by adding the pagination params to the proxy ([7a26759](https://github.com/Chia-Network/Climate-Portal/commit/7a267595092254ca4ef5e210aab06c54df42b3c7))
* add pagination by adding the pagination params to the proxy ([0d07b60](https://github.com/Chia-Network/Climate-Portal/commit/0d07b60aa1ad605e0cca7fadcbef7949081ebfc2))
* add projects endpoint proxy ([937597c](https://github.com/Chia-Network/Climate-Portal/commit/937597ce83bfb42cdd20b4ee5f853352b9aeccc6))
* add proxy requests ([5309cfa](https://github.com/Chia-Network/Climate-Portal/commit/5309cfad54c33ed3ca2a714d61fbdd3e3155b476))
* add tokenize endpoint ([90df4bf](https://github.com/Chia-Network/Climate-Portal/commit/90df4bfe06cc7ccc8dc9027cc28e687c4a81f753))
* add tokenize endpoint ([1af0619](https://github.com/Chia-Network/Climate-Portal/commit/1af06192d90a07653ac7a2ad2962e607c5e2f63d))
* add tokenize endpoint ([c45b275](https://github.com/Chia-Network/Climate-Portal/commit/c45b2751826374d57e3e73bebe768ca9674d8fa4))
* add tokenize endpoint ([ebc94f8](https://github.com/Chia-Network/Climate-Portal/commit/ebc94f8be5a06d5aafc1e3e5cc302e3d740b9a4a))
* add tokenize endpoint ([f3547f7](https://github.com/Chia-Network/Climate-Portal/commit/f3547f7814fc69bc32222f150d87692570d5e400))
* add tokenize endpoint ([44869cd](https://github.com/Chia-Network/Climate-Portal/commit/44869cd7dfec5a7b72bfa9c70dab335bb63f9286))
* add tokenize endpoint ([88fc089](https://github.com/Chia-Network/Climate-Portal/commit/88fc0899fe20cb3c801763f5bfca8f369e7162d7))
* add tokenize endpoint ([ba0ee80](https://github.com/Chia-Network/Climate-Portal/commit/ba0ee806b99ca763e7e59adea3045153bd71db21))
* add tokenize endpoint ([0ebbab8](https://github.com/Chia-Network/Climate-Portal/commit/0ebbab89cdd614d667bd5eefe2feb4c35b92c285))
* add tokenize endpoint ([250e139](https://github.com/Chia-Network/Climate-Portal/commit/250e139f7e72d8ab0f2f75f67d1e1308c72841c9))
* add yaml ([1ec6417](https://github.com/Chia-Network/Climate-Portal/commit/1ec641704600e3a838521fe303b825702ca3dd5f))
* add yaml ([3d06d9e](https://github.com/Chia-Network/Climate-Portal/commit/3d06d9ea0146e0dd36b0832719f296e40ecf36c0))
* config option to update climate warehouse units ([295b297](https://github.com/Chia-Network/Climate-Portal/commit/295b2978b6fe7477ba42b55aaebd7bd3826c2b42))
* detokenize ([a2429df](https://github.com/Chia-Network/Climate-Portal/commit/a2429df0c69a49a9611ccfe2a3d8007622576c86))
* detokenize ([43d36b0](https://github.com/Chia-Network/Climate-Portal/commit/43d36b0e88b2744ef6a275c138b7af5c7755533d))
* get sore ids from datalayer ([8f741ef](https://github.com/Chia-Network/Climate-Portal/commit/8f741efa712db1a7574f68cbf937fbf840fb2fc3))
* get store ids from datalayer ([6b837c6](https://github.com/Chia-Network/Climate-Portal/commit/6b837c635889747b481eaa7c55f0938059fdb348))
* get store ids from datalayer ([b0eee6e](https://github.com/Chia-Network/Climate-Portal/commit/b0eee6e17527c06cbea52c39dc01dcec0658cbc4))
* get store ids from datalayer ([da96dd2](https://github.com/Chia-Network/Climate-Portal/commit/da96dd23e407bae091ae9ec9d7cb085d8bbf0d2c))
* get store ids from datalayer ([d0d759b](https://github.com/Chia-Network/Climate-Portal/commit/d0d759ba2b6462e8368aed81143a0b8fd819260c))
* package into executable ([a36c062](https://github.com/Chia-Network/Climate-Portal/commit/a36c062b90990de315863c39c43ec9d8ac06a402))
* remove default fee ([32494fe](https://github.com/Chia-Network/Climate-Portal/commit/32494fe1b633b5990d876ee348535be6736c6f9a))
* remove fee field ([ff0b071](https://github.com/Chia-Network/Climate-Portal/commit/ff0b071f83a27cc2a1f3350b60d89d71a503a159))
* replace detok file with detok string ([5701455](https://github.com/Chia-Network/Climate-Portal/commit/5701455768b2d61522854b49a5ca7b719681533b))
* replace detok file with detok string ([76a8627](https://github.com/Chia-Network/Climate-Portal/commit/76a862791affba9790da1c707a9aebe47591c643))
* return data for ui from detok-file endpoint ([2fd3e89](https://github.com/Chia-Network/Climate-Portal/commit/2fd3e899710449593e3b857d46e2b6595cd1f4b9))
* return data for ui from detok-file endpoint ([66cf8a9](https://github.com/Chia-Network/Climate-Portal/commit/66cf8a95d8dc0c89d775ef05ec6e2e76b7fa9201))
* send detok confirmation ([89c9d7d](https://github.com/Chia-Network/Climate-Portal/commit/89c9d7de5c0cebceaf4f488c6f967c2d720ee11e))
* set parse detok unit information to amount in detok file ([0ed694a](https://github.com/Chia-Network/Climate-Portal/commit/0ed694a0ea0bc580842738640e9691a1318a6e60))



Loading

0 comments on commit 68c972e

Please sign in to comment.