diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..7c596ce8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,65 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + Release: + runs-on: ubuntu-latest + steps: + - name: Wait for lint and tests to succeed + uses: lewagon/wait-on-check-action@v0.2 + with: + ref: ${{ github.ref }} + check-name: 'LintAndTest' + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 10 + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Validate tag version + run: | + version=$(cat package/version.txt) # get cloudshell-iac-terraform version + tag=${GITHUB_REF/refs\/tags\//} # get tag name + tag="${tag:1}" # remove the 'v' prefix from the tag that triggered this action + echo $version + echo $tag + if [ "$tag" == "$version" ] + then + echo "Tag and version are equal" + else + echo "Error: Tag and version are not equal, cannot create a release" + exit 1 + fi + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + if [ -f package/requirements.txt ]; then pip install -r package/requirements.txt; fi + pip install setuptools wheel twine + + - name: Build + run: | + cd package + python setup.py sdist bdist_wheel + + - name: Create Release and Upload Artifacts + uses: softprops/action-gh-release@v1 + with: + files: dist/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish to Pypi + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + twine upload dist/* diff --git a/package/setup.py b/package/setup.py index 352aef7c..680d45d3 100644 --- a/package/setup.py +++ b/package/setup.py @@ -24,7 +24,7 @@ include_package_data=True, keywords="sandbox cloud IaC cloudshell terraform", classifiers=[ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Topic :: Software Development :: Libraries", "License :: OSI Approved :: Apache Software License", ], diff --git a/package/version.txt b/package/version.txt index 6c6aa7cb..afaf360d 100644 --- a/package/version.txt +++ b/package/version.txt @@ -1 +1 @@ -0.1.0 \ No newline at end of file +1.0.0 \ No newline at end of file diff --git a/shells/backends/azure_tf_backend/shell-definition.yaml b/shells/backends/azure_tf_backend/shell-definition.yaml index 39fac7e0..a9e496de 100644 --- a/shells/backends/azure_tf_backend/shell-definition.yaml +++ b/shells/backends/azure_tf_backend/shell-definition.yaml @@ -3,7 +3,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0 metadata: template_name: Azure Tf Backend template_author: Anonymous - template_version: 0.1.0 + template_version: 1.0.0 template_icon: shell-icon.png description: > diff --git a/shells/generic_terraform_service/src/requirements.txt b/shells/generic_terraform_service/src/requirements.txt index ccb36372..dd6d4b1b 100644 --- a/shells/generic_terraform_service/src/requirements.txt +++ b/shells/generic_terraform_service/src/requirements.txt @@ -1,2 +1,2 @@ -cloudshell-iac-terraform==0.1.0 -cloudshell-shell-core == 5.0.5 \ No newline at end of file +cloudshell-iac-terraform==1.0.0 +cloudshell-shell-core==5.0.5 \ No newline at end of file