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