2020-04-13 11:23:55 +03:00
name : CD
on :
push :
2020-04-14 12:43:12 +03:00
tags :
- '*'
2020-04-13 11:23:55 +03:00
jobs :
release-osx :
runs-on : macos-latest
steps :
- uses : actions/checkout@v2
2020-04-14 12:57:14 +03:00
- name : Get version
id : get_version
run : echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
2020-04-14 12:43:12 +03:00
- name : Build
run : cargo build
- name : Run tests
run : make test
- name : Run clippy
run : make clippy
2020-04-13 11:23:55 +03:00
- name : Build Release
run : make build-release
2020-04-14 12:48:36 +03:00
- name : Set SHA
id : shasum
run : |
echo ::set-output name=sha::"$(shasum -a 256 ./target/gitui-mac.tar.gz | awk '{printf $1}')"
2020-04-13 11:23:55 +03:00
- name : Create Release
id : create_release
uses : actions/create-release@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
tag_name : ${{ github.ref }}
2020-04-14 13:05:37 +03:00
release_name : ${{ github.ref }}
2020-04-13 11:23:55 +03:00
draft : false
prerelease : true
- name : Upload Release Asset
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
upload_url : ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path : ./target/gitui-mac.tar.gz
asset_name : gitui-mac.tar.gz
asset_content_type : application/gzip
- name : Bump Brew
env :
HOMEBREW_GITHUB_API_TOKEN : ${{ secrets.BREW_TOKEN }}
run : |
brew tap extrawurst/tap
2020-04-14 12:57:14 +03:00
brew bump-formula-pr -f --version=${{ steps.get_version.outputs.version }} --no-browse --no-audit \
2020-04-13 11:23:55 +03:00
--sha256=${{ steps.shasum.outputs.sha }} \
2020-04-14 13:05:37 +03:00
--url="https://github.com/extrawurst/gitui/releases/download/${{ steps.get_version.outputs.version }}/gitui-mac.tar.gz" \
2020-04-13 11:23:55 +03:00
extrawurst/tap/gitui