From de44dded80902b4f6435bf4fb3329b9d94e56e6c Mon Sep 17 00:00:00 2001 From: Rick Peyton Date: Fri, 21 Jun 2019 23:33:18 -0500 Subject: [PATCH] Add circle ci config for gem publishing --- .circleci/config.yml | 29 +++++++++++++++++++++++++++++ .circleci/setup-rubygems.sh | 3 +++ 2 files changed, 32 insertions(+) create mode 100755 .circleci/setup-rubygems.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 942afe8..f5aeaac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -55,3 +55,32 @@ jobs: - store_artifacts: path: /tmp/test-results destination: test-results + deploy: + docker: + - image: circleci/ruby:2.4.6 + + working_directory: ~/repo + + steps: + - checkout + - run: + name: Setup Rubygems + command: bash .circleci/setup-rubygems.sh + + - run: + name: Publish to Rubygems + command: | + gem build nintendo_eshop.gemspec + gem push "nintendo_eshop-$(git describe --tags).gem" + +workflows: + version: 2 + test-deploy: + jobs: + - build + - deploy: + filters: + tags: + only: /.*/ + branches: + ignore: /.*/ diff --git a/.circleci/setup-rubygems.sh b/.circleci/setup-rubygems.sh new file mode 100755 index 0000000..252b4f8 --- /dev/null +++ b/.circleci/setup-rubygems.sh @@ -0,0 +1,3 @@ +mkdir ~/.gem +echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials +chmod 0600 /home/circleci/.gem/credentials