ci: add action to release cli-ext binaries

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4342
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 2b7686bda333d977aa20a1ff10f7b3179509eac3
This commit is contained in:
Divi 2022-06-08 03:54:36 +05:30 committed by hasura-bot
parent 270fe74f67
commit b7c414a875
4 changed files with 9 additions and 8 deletions

View File

@ -1,5 +1,5 @@
BUILDDIR := bin
BINARY_ASSETS := $(BUILDDIR)/cli-ext-hasura-node12-linux-x64 $(BUILDDIR)/cli-ext-hasura-node12-macos-x64 $(BUILDDIR)/cli-ext-hasura-node12-win-x64.exe $(BUILDDIR)/cli-ext-hasura-node12-linux-arm64 $(BUILDDIR)/cli-ext-hasura-node16-macos-arm64
BINARY_ASSETS := $(BUILDDIR)/cli-ext-linux-amd64 $(BUILDDIR)/cli-ext-darwin-amd64 $(BUILDDIR)/cli-ext-windows-amd64 $(BUILDDIR)/cli-ext-linux-arm64 $(BUILDDIR)/cli-ext-darwin-arm64
BINARY_ASSET_CHECKSUMS := $(patsubst %,%.sha256,$(BINARY_ASSETS))
GLOBALBUILDDIR ?= /build

View File

@ -8,7 +8,8 @@
"pretranspile": "npm run get-shared-modules",
"transpile": "rm -rf build/* && babel --extensions '.ts,.js' ./src ./tests --out-dir build",
"prebuild": "npm run transpile",
"build": "rm -rf ./bin/* && pkg ./build/command.js --output ./bin/cli-ext-hasura -t node12-linux-x64,node12-macos-x64,node12-win-x64,node12-linux-arm64,node16-macos-arm64",
"build": "rm -rf ./bin/* && pkg ./build/command.js --output ./bin/cli-ext -t node12-linux-x64,node12-macos-x64,node12-win-x64,node12-linux-arm64,node16-macos-arm64",
"postbuild": "ls bin | grep \"^cli-ext-\" | grep -v sha256 | xargs -L 1 -I{} /bin/bash -c 'mv bin/{} bin/\"$(cut -d- --complement -f3 <(echo {}) | sed \"s/x64/amd64/g; s/win/windows/g; s/macos/darwin/g; s/\\.exe//g\")\"'",
"pretest": "npm run transpile && babel ./tests --out-dir _tmptests",
"posttest": "rm -rf _tmptests",
"test": "node ./_tmptests/index.js",

View File

@ -57,11 +57,11 @@ clean-cli-ext:
.PHONY: copy-cli-ext
copy-cli-ext: clean-cli-ext
cp $(CLI_EXT_BIN_DIR)/cli-ext-hasura-node12-linux-x64 ./internal/cliext/static-bin/linux/amd64/cli-ext
cp $(CLI_EXT_BIN_DIR)/cli-ext-hasura-node12-linux-arm64 ./internal/cliext/static-bin/linux/arm64/cli-ext
cp $(CLI_EXT_BIN_DIR)/cli-ext-hasura-node12-macos-x64 ./internal/cliext/static-bin/darwin/amd64/cli-ext
cp $(CLI_EXT_BIN_DIR)/cli-ext-hasura-node16-macos-arm64 ./internal/cliext/static-bin/darwin/arm64/cli-ext
cp $(CLI_EXT_BIN_DIR)/cli-ext-hasura-node12-win-x64.exe ./internal/cliext/static-bin/windows/amd64/cli-ext.exe
cp $(CLI_EXT_BIN_DIR)/cli-ext-linux-amd64 ./internal/cliext/static-bin/linux/amd64/cli-ext
cp $(CLI_EXT_BIN_DIR)/cli-ext-linux-arm64 ./internal/cliext/static-bin/linux/arm64/cli-ext
cp $(CLI_EXT_BIN_DIR)/cli-ext-darwin-amd64 ./internal/cliext/static-bin/darwin/amd64/cli-ext
cp $(CLI_EXT_BIN_DIR)/cli-ext-darwin-arm64 ./internal/cliext/static-bin/darwin/arm64/cli-ext
cp $(CLI_EXT_BIN_DIR)/cli-ext-windows-amd64 ./internal/cliext/static-bin/windows/amd64/cli-ext.exe
# run tests
.PHONY: test

View File

@ -29,7 +29,7 @@ func getCliExtFileContent(ec *cli.ExecutionContext) ([]byte, error) {
return cliExtFileContent, nil
}
cliExtVersion := "v2.0.0"
cliExtVersion := "v2.4.0-beta.3"
ec.Logger.Warn("Unable to find an embedded cli-ext. So trying to fetch it from CDN")
ec.Logger.Warn("Tip: --cli-ext-path can be used for setting up cli-ext from local file system")
CDNpath := fmt.Sprintf("https://graphql-engine-cdn.hasura.io/cli-ext/releases/versioned/%s/cli-ext-%s-%s",