-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github actions for github release
- Loading branch information
Showing
3 changed files
with
90 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
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 Nodejs | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12.x' | ||
|
||
- name: npm install | ||
run: | | ||
npm install | ||
- name: Install hub | ||
run: brew install hub | ||
|
||
- name: update release note | ||
run: | | ||
version=$(grep '"version"' package.json | sed 's/"version":[[:space:]]*"//' | sed 's/",//' | tr -d [:space:]) | ||
if [ -z "$version" ]; then | ||
echo "taiko screencast version is not set" | ||
exit 1 | ||
fi | ||
echo -e "taiko-screencast v$version\n\n" > desc.txt | ||
release_description=$(ruby -e "$(curl -sSfL https://github.com/getgauge/gauge/raw/master/build/create_release_text.rb)" taiko-screencast getgauge-contrib) | ||
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 | ||
- 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 }}' |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: publish to NPM | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | ||
NPM_TOKEN: '${{ secrets.NPM_TOKEN }}' | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js 12 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- name: npm deploy | ||
run: | | ||
npm install | ||
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>~/.npmrc | ||
npm publish |
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,3 +1,15 @@ | ||
#!/usr/bin/env bash | ||
export version=$(grep '"version"' package.json | sed 's/"version":[[:space:]]*"//' | sed 's/",//' | tr -d [:space:]) | ||
curl -sSfL https://github.com/getgauge/gauge/raw/master/build/github_release.sh | sh | ||
#!/bin/bash | ||
|
||
if [ -z "$GITHUB_TOKEN" ]; then | ||
echo "GITHUB_TOKEN is not set." | ||
echo "Please create an personal access token with repo:public_repo scopes." | ||
exit 1 | ||
fi | ||
|
||
curl \ | ||
-X POST \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
-H "Accept: application/vnd.github.ant-man-preview+json" \ | ||
-H "Content-Type: application/json" \ | ||
https://api.github.com/repos/getgauge-contrib/taiko-screencast/deployments \ | ||
--data '{"ref": "master", "required_contexts": [], "environment": "production"}' |