BTA-11168 Add an SDK release workflow (#10) #39
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 Gem | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
release-transferzero-sdk: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.2 | |
- run: bundle install | |
- name: Publish the gem | |
run: | | |
mkdir -p $HOME/.gem | |
touch $HOME/.gem/credentials | |
chmod 0600 $HOME/.gem/credentials | |
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | |
gem build *.gemspec | |
gem push *.gem | |
env: | |
GEM_HOST_API_KEY: "${{secrets.GH_RELEASER_RUBYGEMS_API_KEY}}" | |
- name: Tag the release | |
run: | | |
NEXT_TAG=$(awk '/VERSION/{print $3}' lib/transferzero-sdk/version.rb | tr -d "'") | |
git tag $NEXT_TAG | |
git push --tags |