Skip to content

Commit

Permalink
Adding python and dotnet sdk (#7)
Browse files Browse the repository at this point in the history
* generated dotnet and python sdks

* removed supported languages part from docs

* updated ci from pypi and nuget

* added version.txt in dotnet sdk using ci

* fixed version issue with python sdk

* fixed dotnet null pointer reference issue

* fixing dotnet ci

* fixing dotnet ci

* added png logo

* added logo in dotnet sdk

* added python and dotnet sdks

* fixed pulumi go example bug

* shortened requirements.txt for python example
  • Loading branch information
KnockOutEZ authored Dec 19, 2024
1 parent 920d2aa commit bef4b4a
Show file tree
Hide file tree
Showing 123 changed files with 12,914 additions and 20 deletions.
Binary file added .github/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 75 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,96 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: https://registry.npmjs.org

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
- name: Get the version

- name: Get Version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
run: |
# Remove the 'v' prefix from the tag
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "::set-output name=VERSION::$VERSION"
# Create version files for various SDKs
- name: Create version files
run: |
mkdir -p sdk/dotnet
echo "$VERSION" > sdk/dotnet/version.txt
# Update Python package version
mkdir -p sdk/python
cat > sdk/python/setup.py <<EOL
from setuptools import setup, find_packages
setup(
name="pgEdge_pulumi_pgedge",
version="${VERSION}",
packages=find_packages(),
install_requires=[
"pulumi>=3.0.0,<4.0.0",
],
)
EOL
- name: Build and Publish Node.js SDK
working-directory: ./sdk/nodejs
run: |
npm install
sed -i 's/"name": "@pgEdge\/pulumi-pgedge"/"name": "@pgedge\/pulumi-pgedge"/g' package.json
npm version ${{ steps.get_version.outputs.VERSION }} --no-git-tag-version
npm version ${{ env.VERSION }} --no-git-tag-version
npm run build
npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Build and Publish Python SDK
working-directory: ./sdk/python
run: |
python -m pip install --upgrade pip
python -m pip install build twine
# Clean any existing builds
rm -rf dist/ build/ *.egg-info/
# Build the package
python -m build
# Upload to PyPI
python -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

- name: Build and Publish .NET SDK
working-directory: ./sdk/dotnet
run: |
# Clean any existing artifacts
dotnet clean
# Restore packages
dotnet restore
dotnet build --configuration Release -v detailed
dotnet pack --configuration Release --no-build -o out
dotnet nuget push out/*.nupkg \
--source https://api.nuget.org/v3/index.json \
--api-key ${{ secrets.NUGET_TOKEN }} \
--skip-duplicate
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WORKING_DIR := $(shell pwd)

OS := $(shell uname)

.PHONY: development provider build_sdks build_nodejs build_go cleanup # build_dotnet build_python
.PHONY: development provider build_sdks build_nodejs build_go build_dotnet build_python cleanup

development:: install_plugins provider lint_provider build_sdks install_sdks cleanup # Build the provider & SDKs for a development environment

Expand All @@ -35,7 +35,7 @@ tfgen:: install_plugins
provider:: tfgen install_plugins # build the provider binary
(cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${PROVIDER})

build_sdks:: install_plugins provider build_nodejs build_go # build all the sdks except python(build_python), dotnet(build_dotnet)
build_sdks:: install_plugins provider build_nodejs build_go build_dotnet build_python

build_nodejs:: VERSION := $(shell pulumictl get version --language javascript)
build_nodejs:: install_plugins tfgen # build the node sdk
Expand Down Expand Up @@ -83,7 +83,7 @@ help::
expand -t20

clean::
rm -rf sdk/{nodejs,go} # dotnet, python
rm -rf sdk/{nodejs,go,dotnet,python}

install_plugins::
[ -x $(shell which pulumi) ] || curl -fsSL https://get.pulumi.com | sh
Expand All @@ -100,7 +100,7 @@ install_go_sdk::
install_nodejs_sdk::
yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin

install_sdks:: install_nodejs_sdk # install_dotnet_sdk install_python_sdk
install_sdks:: install_nodejs_sdk install_dotnet_sdk install_python_sdk

test::
cd examples && go test -v -tags=all -parallel ${TESTPARALLELISM} -timeout 2h
Expand Down
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ Before you begin, ensure you have the following tools installed:
- [Yarn](https://yarnpkg.com/getting-started/install)
- [TypeScript](https://www.typescriptlang.org/download)

## Supported Languages

Currently, this provider supports:

- TypeScript
- Go

Support for other languages like Python and .NET is planned for future releases.

## Installation

To use this provider, you need to have Pulumi installed. If you haven't already, you can [install Pulumi here](https://www.pulumi.com/docs/get-started/install/).
Expand Down
Loading

0 comments on commit bef4b4a

Please sign in to comment.