Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CI pipeline #83

Merged
merged 3 commits into from
Mar 6, 2024
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
63 changes: 34 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
yq --version
bash --version
docker version
docker-compose version
docker-compose version
npm i -g nx
- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -141,36 +141,9 @@ jobs:
exit 1
fi

bump-version:
needs: [ template-e2e, template-image-check ]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
name: Bump SDK Version
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Configure Git
run: |
git config --global user.name "galachain-release-bot"
git config --global user.email "[email protected]"
- name: Set version from tag
run: |
TAG=$(git describe --tags --abbrev=0)
VERSION=${TAG:1}
echo "TAG: $TAG"
echo "VERSION: $VERSION"
./unifyVersions.js $VERSION
npm i
git commit -a -m "Bump version to $VERSION [skip ci]"
git tag -fa "$TAG" -m "Release $TAG"
git push -u origin "$TAG"
publish:
name: Publish Release
needs: [ bump-version ]
needs: [ template-e2e, template-image-check ]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -260,3 +233,35 @@ jobs:
context: ./chain-cli/docker
push: true
tags: ghcr.io/${{ steps.lower-repo.outputs.repository }}:latest

bump-version:
needs: [ publish, publish-cli-image ]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
name: Bump SDK Version
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: 'main'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install tools
run: npm i -g semver
- name: Configure Git
run: |
git config --global user.name "galachain-release-bot"
git config --global user.email "[email protected]"
- name: Bump version
run: |
VERSION="$(semver "$(< package.json jq -r '.version')" -i)"
./unifyVersions.js $VERSION
npm i
git commit -am "Bump version to $VERSION"
- name: Push next version release
uses: ad-m/github-push-action@master
with:
branch: 'main'
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion chain-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gala-chain/api",
"version": "1.0.18",
"version": "1.0.19",
"description": "Common types, DTOs (Data Transfer Objects), APIs, signatures, and utils for GalaChain.",
"license": "Apache-2.0",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion chain-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @gala-chain/cli
$ galachain COMMAND
running command...
$ galachain (--version)
@gala-chain/cli/1.0.18 linux-x64 node-v16.16.0
@gala-chain/cli/1.0.19 linux-x64 node-v16.16.0
$ galachain --help [COMMAND]
USAGE
$ galachain COMMAND
Expand Down
12 changes: 6 additions & 6 deletions chain-cli/chaincode-template/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galachain/product",
"version": "1.0.18",
"version": "1.0.19",
"description": "Product Chaincode",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
Expand All @@ -22,16 +22,16 @@
"update-snapshot": "jest --updateSnapshot"
},
"dependencies": {
"@gala-chain/api": "1.0.18",
"@gala-chain/chaincode": "1.0.18",
"@gala-chain/api": "1.0.19",
"@gala-chain/chaincode": "1.0.19",
"dotenv": "^16.0.1",
"fabric-contract-api": "2.4.2",
"fabric-shim": "2.4.2"
},
"devDependencies": {
"@gala-chain/cli": "1.0.18",
"@gala-chain/client": "1.0.18",
"@gala-chain/test": "1.0.18",
"@gala-chain/cli": "1.0.19",
"@gala-chain/client": "1.0.19",
"@gala-chain/test": "1.0.19",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/axios": "^0.14.0",
"@types/jest": "^29.5.12",
Expand Down
2 changes: 1 addition & 1 deletion chain-cli/oclif.manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.18",
"version": "1.0.19",
"commands": {
"connect": {
"id": "connect",
Expand Down
4 changes: 2 additions & 2 deletions chain-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gala-chain/cli",
"version": "1.0.18",
"version": "1.0.19",
"description": "CLI for GalaChain to manage and deploy chaincodes",
"license": "Apache-2.0",
"bin": {
Expand All @@ -14,7 +14,7 @@
"/oclif.manifest.json"
],
"dependencies": {
"@gala-chain/api": "1.0.18",
"@gala-chain/api": "1.0.19",
"@noble/secp256k1": "^1.7.1",
"@oclif/core": "^2",
"@oclif/plugin-help": "^2",
Expand Down
4 changes: 2 additions & 2 deletions chain-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gala-chain/client",
"version": "1.0.18",
"version": "1.0.19",
"description": "GalaChain client library",
"license": "Apache-2.0",
"scripts": {
Expand All @@ -21,7 +21,7 @@
"lib"
],
"dependencies": {
"@gala-chain/api": "1.0.18",
"@gala-chain/api": "1.0.19",
"axios": "^1.6.0",
"jsonschema": "^1.4.1",
"tslib": "^2.6.2",
Expand Down
6 changes: 3 additions & 3 deletions chain-test/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "@gala-chain/test",
"version": "1.0.18",
"version": "1.0.19",
"description": "Unit testing and integration testing for GalaChain",
"license": "Apache-2.0",
"dependencies": {
"@gala-chain/client": "1.0.18",
"@gala-chain/client": "1.0.19",
"nanoid": "^3.3.6",
"tslib": "^2.6.2",
"path": "0.12.7",
"process": "0.11.10",
"@jest/globals": "29.7.0"
},
"peerDependencies": {
"@gala-chain/api": "1.0.18",
"@gala-chain/api": "1.0.19",
"bignumber.js": "*",
"class-transformer": "*",
"elliptic": "*",
Expand Down
4 changes: 2 additions & 2 deletions chaincode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gala-chain/chaincode",
"version": "1.0.18",
"version": "1.0.19",
"description": "Framework for building chaincodes on GalaChain",
"license": "Apache-2.0",
"type": "commonjs",
Expand All @@ -21,7 +21,7 @@
"test": "jest"
},
"dependencies": {
"@gala-chain/api": "1.0.18",
"@gala-chain/api": "1.0.19",
"fabric-contract-api": "2.4.2",
"fabric-shim": "2.4.2",
"nanoid": "^3.3.6",
Expand Down
16 changes: 8 additions & 8 deletions licenses/licenses.csv
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@
"@eslint/[email protected]","@eslint/js","8.55.0","https://github.com/eslint/eslint","ESLint JavaScript language implementation","MIT"
"@fidm/[email protected]","@fidm/asn1","1.0.4","https://github.com/fidm/asn1","ASN.1/DER, PEM for Node.js","MIT"
"@fidm/[email protected]","@fidm/x509","1.2.1","https://github.com/fidm/x509","Pure JavaScript X509 certificate tools for Node.js","MIT"
"@gala-chain/[email protected].18","@gala-chain/api","1.0.18","","Common types, DTOs (Data Transfer Objects), APIs, signatures, and utils for GalaChain.","Apache-2.0"
"@gala-chain/[email protected].18","@gala-chain/chaincode","1.0.18","","Framework for building chaincodes on GalaChain","Apache-2.0"
"@gala-chain/[email protected].18","@gala-chain/cli","1.0.18","","CLI for GalaChain to manage and deploy chaincodes","Apache-2.0"
"@gala-chain/[email protected].18","@gala-chain/client","1.0.18","","GalaChain client library","Apache-2.0"
"@gala-chain/[email protected].18","@gala-chain/sdk","1.0.18","","Welcome to developing with GalaChain! GalaChain SDK is a set of TS tools to help you develop on GalaChain:","UNLICENSED"
"@gala-chain/[email protected].18","@gala-chain/test","1.0.18","","Unit testing and integration testing for GalaChain","Apache-2.0"
"@gala-chain/[email protected].19","@gala-chain/api","1.0.19","","Common types, DTOs (Data Transfer Objects), APIs, signatures, and utils for GalaChain.","Apache-2.0"
"@gala-chain/[email protected].19","@gala-chain/chaincode","1.0.19","","Framework for building chaincodes on GalaChain","Apache-2.0"
"@gala-chain/[email protected].19","@gala-chain/cli","1.0.19","","CLI for GalaChain to manage and deploy chaincodes","Apache-2.0"
"@gala-chain/[email protected].19","@gala-chain/client","1.0.19","","GalaChain client library","Apache-2.0"
"@gala-chain/[email protected].19","@gala-chain/sdk","1.0.19","","Welcome to developing with GalaChain! GalaChain SDK is a set of TS tools to help you develop on GalaChain:","UNLICENSED"
"@gala-chain/[email protected].19","@gala-chain/test","1.0.19","","Unit testing and integration testing for GalaChain","Apache-2.0"
"@gar/[email protected]","@gar/promisify","1.1.3","https://github.com/wraithgar/gar-promisify","Promisify an entire class or object","MIT"
"@grpc/[email protected]","@grpc/grpc-js","1.9.7","https://github.com/grpc/grpc-node/tree/master/packages/grpc-js","gRPC Library for Node - pure JS implementation","Apache-2.0"
"@grpc/[email protected]","@grpc/proto-loader","0.6.13","https://github.com/grpc/grpc-node","gRPC utility library for loading .proto files","Apache-2.0"
Expand Down Expand Up @@ -214,8 +214,7 @@
"@nx/[email protected]","@nx/jest","17.2.8","https://github.com/nrwl/nx","The Nx Plugin for Jest contains executors and generators allowing your workspace to use the powerful Jest testing capabilities.","MIT"
"@nx/[email protected]","@nx/js","17.2.8","https://github.com/nrwl/nx","The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ","MIT"
"@nx/[email protected]","@nx/linter","17.2.8","https://github.com/nrwl/nx","The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.","MIT"
"@nx/[email protected]","@nx/nx-linux-x64-gnu","17.2.8","https://github.com/nrwl/nx","","MIT"
"@nx/[email protected]","@nx/nx-linux-x64-musl","17.2.8","https://github.com/nrwl/nx","","MIT"
"@nx/[email protected]","@nx/nx-darwin-arm64","17.2.8","https://github.com/nrwl/nx","","MIT"
"@nx/[email protected]","@nx/workspace","17.2.8","https://github.com/nrwl/nx","The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.","MIT"
"@oclif/[email protected]","@oclif/command","1.8.36","https://github.com/oclif/command","oclif base command","MIT"
"@oclif/[email protected]","@oclif/config","1.18.16","https://github.com/oclif/config","base config object and standard interfaces for oclif components","MIT"
Expand Down Expand Up @@ -684,6 +683,7 @@
"[email protected]","fs-minipass","2.1.0","https://github.com/npm/fs-minipass","fs read and write streams based on minipass","ISC"
"[email protected]","fs-minipass","3.0.3","https://github.com/npm/fs-minipass","fs read and write streams based on minipass","ISC"
"[email protected]","fs.realpath","1.0.0","https://github.com/isaacs/fs.realpath","Use node's fs.realpath, but fall back to the JS implementation if the native one fails","ISC"
"[email protected]","fsevents","2.3.3","https://github.com/fsevents/fsevents","Native Access to MacOS FSEvents","MIT"
"[email protected]","function-bind","1.1.2","https://github.com/Raynos/function-bind","Implementation of Function.prototype.bind","MIT"
"[email protected]","functional-red-black-tree","1.0.1","https://github.com/mikolalysenko/functional-red-black-tree","A fully persistent balanced binary search tree","MIT"
"[email protected]","gauge","3.0.2","https://github.com/iarna/gauge","A terminal based horizontal guage","ISC"
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@gala-chain/sdk",
"version": "1.0.18",
"version": "1.0.19",
"license": "Apache-2.0",
"scripts": {
"lint": "nx run-many -t lint",
"fix": "nx run-many -t fix",
"build": "nx run-many -t build",
"madge": "nx run-many -t madge",
"test": "nx run-many -t test",
"set-version": "node unifyVersions.js",
"licenses": "license-checker --csv --customPath ./licenses/format.json > ./licenses/licenses.csv",
"typedoc-chain-api": "typedoc --tsconfig ./tsconfig.base.json --hideGenerator --plugin typedoc-plugin-markdown --githubPages false --out ./docs/chain-api-docs ./chain-api/src && rm ./docs/chain-api-docs/README.md",
"typedoc-chain-client": "typedoc --tsconfig ./tsconfig.base.json --hideGenerator --plugin typedoc-plugin-markdown --githubPages false --out ./docs/chain-client-docs ./chain-client/src && rm ./docs/chain-client-docs/README.md",
Expand Down
Loading