Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release actions #163

Merged
merged 3 commits into from Oct 15, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/deployment.yml
@@ -0,0 +1,73 @@
name: Deploy

on: [deployment]

jobs:
deploy:
name: Create Draft with assets
runs-on: macos-latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
steps:
- uses: actions/checkout@v1

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Build artifacts
run: |
pip install -r requirements.txt
python build.py --dist
- name: Install hub
run: brew install hub
- name: update
run: |
cd bin
if [ -z "$version" ]; then
version=$(ls gauge-python* | head -1 | sed "s/\.[^\.]*$//" | sed "s/gauge-python-//" | sed | sed "s/-[a-z]*\.[a-z0-9_]*$//");
fi

artifacts=()
dir=`pwd`
for i in `ls`; do
artifacts+="$dir/$i "
done
cd ..

echo "---------------------------"
echo "Upadating release v$version"
echo "---------------------------"

echo -e "Gauge Python v$version\n\n" > desc.txt

release_description=$(ruby -e "$(curl -sSfL https://github.com/getgauge/gauge/raw/master/build/create_release_text.rb)" gauge-python getgauge)

echo "$release_description" >> desc.txt

echo "Creating new draft for release v$version"
hub release create -d -F ./desc.txt "v$version"

rm -rf desc.txt

echo "Start uploading assets..."
for i in `ls $artifacts`; do
hub release edit -m "" -a $i "v$version"
if [ $? -ne 0 ];then
exit 1
fi
done

- name: 'deployment success'
if: success()
uses: 'deliverybot/status@master'
with:
state: 'success'
token: '${{ secrets.GITHUB_TOKEN }}'

- name: 'deployment failure'
if: failure()
uses: 'deliverybot/status@master'
with:
state: 'failure'
token: '${{ secrets.GITHUB_TOKEN }}'
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,27 @@
name: release

on:
release:
types: [published]

jobs:
release:
name: Deploy to PyPi
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
PYPI_USER: '${{ secrets.PYPI_USER }}'
PYPI_PASSWORD: '${{ secrets.PYPI_PASSWORD }}'
steps:
- uses: actions/checkout@v1

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Upload PyPi package
run: |
pip install -r requirements.txt
python build.py --dist
python -m twine upload -u ${PYPI_USER} -p ${PYPI_PASSWORD} dist/getgauge*
25 changes: 19 additions & 6 deletions README.md
Expand Up @@ -3,7 +3,7 @@
[![Actions Status](https://github.com/getgauge/gauge-python/workflows/build/badge.svg)](https://github.com/getgauge/gauge-js/actions)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)

This project adds Python [language plugin](https://docs.gauge.org/plugins.html#language-reporting-plugins) for [gauge](http://getgauge.io).
This project adds Python [language plugin](https://docs.gauge.org/plugins.html#language-reporting-plugins) for [gauge](http://gauge.org).

## Getting started

Expand Down Expand Up @@ -93,12 +93,8 @@ python build.py --install
python build.py --dist
```

This will create a .zip file in bin directory and a .tar.gz file in dist directory. The zip file can be uploaded to Github release and the .tar.gz file can be uploaded to PyPi
This will create a .zip file in bin directory and a .tar.gz file in dist directory.

##### Uploading to PyPI
```
twine upload dist/FILE_NAME
```

##### Creating Nightly distributable
```
Expand All @@ -107,6 +103,23 @@ NIGHTLY=true python build.py --dist

This will create the .zip nightly file and a .dev.DATE.tar.gz(PyPi pre release package) file.

## Deployment

Only contributors with push access can create a deployment.

The deployment process is managed via Github Actions.

Follow these steps to deploy gauge-python.

* Create a Personal Access Token in Github with `repo:public_repo` scope (skip this step if you already have a PAT).
* Run `GITHUB_TOKEN={Your token} sh release.sh` in `gauge-python` dir. This will trigger a deployment workflow on Github Actions. This workflow creates a release draft with all required assets and information.
* Visit to the release draft, analyze and update the contents (remove unnecessary entries, mention Contributors, remove dependabot PR entries).
* Publish the draft release.
* Once the draft is published it will trigger another workflow on Github Actions, which will perform all the Post release tasks, In case of gauge-python it will upload the `getgauge` python packge to `PyPi`.
* Once it's done please update the new release information in [gauge-repository](https://github.com/getgauge/gauge-repository/blob/master/python-install.json)
* That's it. Now the release can be announced on the required community platforms (chat, google group etc.)


## Examples

- Selenium: This project serves as an example for writing automation using Gauge. It uses selenium and various Gauge/Gauge-Python features. For more details, Check out the [gauge-example-python](https://github.com/kashishm/gauge-example-python) repository.
Expand Down
216 changes: 0 additions & 216 deletions docs/Makefile

This file was deleted.