Merge pull request #13 from getgauge/dependabot/npm_and_yarn/typescri… #10
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
name: release | |
on: | |
push: | |
branches: [master] | |
paths-ignore: | |
- metadata.json | |
- .github | |
- README.md | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: geertvdc/setup-hub@master | |
- name: package and releases | |
run: | | |
ignored="! -path $(pwd) " | |
for i in $(cat .templateignore); do | |
ignored+="! -name $i " | |
done | |
files=$(find $(pwd) -maxdepth 1 $ignored) | |
mkdir ts | |
cp -r $files ./ts | |
zip -r ts.zip ./ts; | |
openssl sha256 ts.zip | cut -d " " -f2 > ts.zip.sha256 | |
version=$(jq -r ".version" metadata.json) | |
hub release create -m "v$version" "v$version" | |
hub release edit -m "" -a ts.zip "v$version" | |
hub release edit -m "" -a ts.zip.sha256 "v$version" | |
- 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: bump version | |
run: | | |
git clean -dfx | |
version=$(jq -r ".version" metadata.json | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g') | |
echo $(jq -r ".version = \"$version\"" metadata.json) | jq . > new_metadata.json | |
cat new_metadata.json > metadata.json | |
git add metadata.json | |
git commit -m "Bumped version to $version" | |
git push "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git" master |