Skip to content
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
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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/*
2 changes: 1 addition & 1 deletion package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
2 changes: 1 addition & 1 deletion package/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
1.0.0
2 changes: 1 addition & 1 deletion shells/backends/azure_tf_backend/shell-definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >
Expand Down
4 changes: 2 additions & 2 deletions shells/generic_terraform_service/src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cloudshell-iac-terraform==0.1.0
cloudshell-shell-core == 5.0.5
cloudshell-iac-terraform==1.0.0
cloudshell-shell-core==5.0.5