-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
not meant for contrib projects Signed-off-by: sriv <[email protected]>
- Loading branch information
Showing
1 changed file
with
25 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
name: Release on PR Merge | ||
|
||
on: deployment | ||
name: deploy | ||
on: [deployment] | ||
|
||
jobs: | ||
release-and-bump-version: | ||
if: github.event.deployment.environment == 'production' | ||
runs-on: ubuntu-latest | ||
deploy: | ||
name: deploy json report | ||
runs-on: macos-latest | ||
env: | ||
GITHUB_TOKEN: '${{ secrets.GAUGEBOT_GITHUB_TOKEN }}' | ||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- uses: geertvdc/setup-hub@master | ||
|
||
- name: Setup go 1.13.1 | ||
uses: actions/setup-go@v1 | ||
with: | ||
|
@@ -23,33 +20,28 @@ jobs: | |
run: | | ||
go run build/make.go --all-platforms | ||
go run build/make.go --all-platforms --distro | ||
- name: Setup git | ||
run: | | ||
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)" | ||
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)" | ||
- name: Deploy | ||
- name: Install hub | ||
run: brew install hub | ||
- name: update | ||
run: | | ||
cd deploy | ||
if [ -z "$version" ]; then | ||
version=$(ls json-report* | head -1 | sed "s/\.[^\.]*$//" | sed "s/json-report-//" | sed "s/-[a-z]*\.[a-z0-9_]*$//"); | ||
version=$(grep '"version"' ../plugin.json | sed 's/"version":[[:space:]]*"//' | sed 's/",//' | tr -d [:space:]) | ||
fi | ||
echo "::set-env name=VERSION::$version" | ||
artifacts=() | ||
dir=`pwd` | ||
for i in `ls`; do | ||
for i in `ls *.zip`; do | ||
artifacts+="$dir/$i " | ||
done | ||
cd .. | ||
echo "---------------------------" | ||
echo "Updating release v$version" | ||
echo "---------------------------" | ||
echo -e "JSON Report v$version\n\n" > desc.txt | ||
release_description=$(ruby -e "$(curl -sSfL https://github.com/getgauge/gauge/raw/master/build/create_release_text.rb)" getgauge-contrib json-report) | ||
release_description=$(ruby -e "$(curl -sSfL https://github.com/getgauge/gauge/raw/master/build/create_release_text.rb)" json-report getgauge-contrib) | ||
echo "$release_description" >> desc.txt | ||
echo "Creating new draft for release v$version" | ||
hub release create -F ./desc.txt "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 | ||
|
@@ -58,21 +50,17 @@ jobs: | |
exit 1 | ||
fi | ||
done | ||
- name: 'deployment success' | ||
if: success() | ||
uses: 'deliverybot/status@master' | ||
with: | ||
state: 'success' | ||
token: '${{ secrets.GITHUB_TOKEN }}' | ||
|
||
- name: Update metadata in gauge-repository | ||
run: | | ||
git clone https://github.com/getgauge/gauge-repository.git | ||
cd gauge-repository | ||
python update_metadata.py json-report $VERSION | ||
commit_message=$(echo -e "Update json-report to v$VERSION") | ||
git commit -am "$commit_message" | ||
git push "https://$GITHUB_ACTOR:[email protected]/getgauge/gauge-repository.git" master | ||
- name: 'deployment failure' | ||
if: failure() | ||
uses: 'deliverybot/status@master' | ||
with: | ||
state: 'failure' | ||
token: '${{ secrets.GITHUB_TOKEN }}' | ||
|
||
- name: Bump up version | ||
run: | | ||
git clean -dfx | ||
git checkout master && git checkout . && git pull --rebase | ||
version=$(python update_version.py) | ||
git commit -am "Bumping up -> $version" | ||
git push "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git" master |