Skip to content

Commit

Permalink
update sdks
Browse files Browse the repository at this point in the history
  • Loading branch information
rawdaGastan committed Dec 18, 2023
1 parent 6781294 commit 875b912
Show file tree
Hide file tree
Showing 13 changed files with 155 additions and 574 deletions.
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ PROVIDER_PATH := provider
VERSION_PATH := ${PROVIDER_PATH}/pkg/version.Version
SCHEMA_PATH := ${PROVIDER_PATH}/cmd/${PROVIDER}/schema.json
WORKING_DIR := $(shell pwd)
VERSION := $(shell pulumictl get version)
LATEST_VERSION := $(shell git describe --tags --abbrev=0 --match="v[0-9]*" HEAD)
VERSION := $(shell git describe --tags --abbrev=0 --match="v[0-9]*" HEAD)

all: prepare lint build schema test

Expand All @@ -26,7 +25,7 @@ prepare:
done

install_latest:
pulumi plugin install resource ${NAME} ${LATEST_VERSION} --server github://api.github.com/threefoldtech/pulumi-threefold
pulumi plugin install resource ${NAME} ${VERSION} --server github://api.github.com/threefoldtech/pulumi-threefold

build: gen
(cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER))
Expand All @@ -38,7 +37,7 @@ schema:
pulumi package get-schema $(WORKING_DIR)/bin/${PROVIDER} > $(WORKING_DIR)/provider/cmd/${PROVIDER}/schema.json

pulumi:
[ -x $(shell which pulumi) ] || curl -fsSL https://get.pulumi.com | sh
curl -fsSL https://get.pulumi.com | sh

test:
@echo "Running Tests"
Expand Down Expand Up @@ -83,7 +82,6 @@ go_sdk:: build
rm -rf sdk/go
pulumi package gen-sdk $(WORKING_DIR)/bin/$(PROVIDER) --language go

nodejs_sdk:: VERSION := $(shell pulumictl get version --language javascript)
nodejs_sdk:: build
rm -rf sdk/nodejs
pulumi package gen-sdk $(WORKING_DIR)/bin/$(PROVIDER) --language nodejs
Expand All @@ -94,15 +92,14 @@ nodejs_sdk:: build
sed -i.bak 's/$${VERSION}/$(VERSION)/g' bin/package.json && \
rm ./bin/package.json.bak

python_sdk:: PYPI_VERSION := $(shell pulumictl get version --language python)
python_sdk:: build
rm -rf sdk/python
pulumi package gen-sdk $(WORKING_DIR)/bin/$(PROVIDER) --language python
cp README.md sdk/python/
cd sdk/python/ && \
python3 setup.py clean --all 2>/dev/null && \
rm -rf ./bin/ ../python.bin/ && cp -R . ../python.bin && mv ../python.bin ./bin && \
sed -i.bak -e 's/^VERSION = .*/VERSION = "$(PYPI_VERSION)"/g' -e 's/^PLUGIN_VERSION = .*/PLUGIN_VERSION = "$(VERSION)"/g' ./bin/setup.py && \
sed -i.bak -e 's/^VERSION = .*/VERSION = "$(VERSION)"/g' -e 's/^PLUGIN_VERSION = .*/PLUGIN_VERSION = "$(VERSION)"/g' ./bin/setup.py && \
rm ./bin/setup.py.bak && \
cd ./bin && python3 setup.py build sdist

Expand Down
17 changes: 10 additions & 7 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@

set -ex

if [ -z ${VERSION+x} ]
if [ -z ${RELEASE_VERSION+x} ]
then
echo 'Error! $VERSION is required.'
echo 'Error! $RELEASE_VERSION is required.'
exit 64
fi

echo $VERSION
echo $RELEASE_VERSION

make pulumi go_sdk nodejs_sdk python_sdk
make lint
goreleaser check

tag_and_push() {
local component="$1"
git tag -a "$component/$VERSION" -m "release $component/$VERSION"
git push origin $component/$VERSION
git tag -a "$component/$RELEASE_VERSION" -m "release $component/$RELEASE_VERSION"
git push origin $component/$RELEASE_VERSION
}


tag_and_push "sdk"

# main
git tag -a $VERSION -m "release $VERSION"
git push origin $VERSION
git tag -a $RELEASE_VERSION -m "release $RELEASE_VERSION"
git push origin $RELEASE_VERSION

make pulumi go_sdk nodejs_sdk python_sdk
71 changes: 71 additions & 0 deletions sdk/go/threefold/internal/pulumiUtilities.go

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

13 changes: 0 additions & 13 deletions sdk/go/threefold/provider.go

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

37 changes: 0 additions & 37 deletions sdk/go/threefold/provider/deployment.go

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

37 changes: 0 additions & 37 deletions sdk/go/threefold/provider/gatewayFQDN.go

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

Loading

0 comments on commit 875b912

Please sign in to comment.