Skip to content

Commit 7ddfb59

Browse files
authored
Merge pull request #60 from QualiSystemsLab/feature/alexaz_release_on_tag_action
release job
2 parents 31a4ce5 + 75bdb52 commit 7ddfb59

File tree

5 files changed

+70
-5
lines changed

5 files changed

+70
-5
lines changed

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
Release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Wait for lint and tests to succeed
13+
uses: lewagon/wait-on-check-action@v0.2
14+
with:
15+
ref: ${{ github.ref }}
16+
check-name: 'LintAndTest'
17+
repo-token: ${{ secrets.GITHUB_TOKEN }}
18+
wait-interval: 10
19+
- name: Checkout Code
20+
uses: actions/checkout@v2
21+
22+
- name: Validate tag version
23+
run: |
24+
version=$(cat package/version.txt) # get cloudshell-iac-terraform version
25+
tag=${GITHUB_REF/refs\/tags\//} # get tag name
26+
tag="${tag:1}" # remove the 'v' prefix from the tag that triggered this action
27+
echo $version
28+
echo $tag
29+
if [ "$tag" == "$version" ]
30+
then
31+
echo "Tag and version are equal"
32+
else
33+
echo "Error: Tag and version are not equal, cannot create a release"
34+
exit 1
35+
fi
36+
37+
- name: Set up Python
38+
uses: actions/setup-python@v2
39+
with:
40+
python-version: '3.7'
41+
42+
- name: Install Dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
if [ -f package/requirements.txt ]; then pip install -r package/requirements.txt; fi
46+
pip install setuptools wheel twine
47+
48+
- name: Build
49+
run: |
50+
cd package
51+
python setup.py sdist bdist_wheel
52+
53+
- name: Create Release and Upload Artifacts
54+
uses: softprops/action-gh-release@v1
55+
with:
56+
files: dist/*
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
60+
- name: Publish to Pypi
61+
env:
62+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
63+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
64+
run: |
65+
twine upload dist/*

package/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
include_package_data=True,
2525
keywords="sandbox cloud IaC cloudshell terraform",
2626
classifiers=[
27-
"Development Status :: 4 - Beta",
27+
"Development Status :: 5 - Production/Stable",
2828
"Topic :: Software Development :: Libraries",
2929
"License :: OSI Approved :: Apache Software License",
3030
],

package/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0
1+
1.0.0

shells/backends/azure_tf_backend/shell-definition.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
33
metadata:
44
template_name: Azure Tf Backend
55
template_author: Anonymous
6-
template_version: 0.1.0
6+
template_version: 1.0.0
77
template_icon: shell-icon.png
88

99
description: >
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
cloudshell-iac-terraform==0.1.0
2-
cloudshell-shell-core == 5.0.5
1+
cloudshell-iac-terraform==1.0.0
2+
cloudshell-shell-core==5.0.5

0 commit comments

Comments
 (0)