Skip to content

Commit

Permalink
DT-109: publish gem to private gemfury repo
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSotoEstrada committed Mar 7, 2023
1 parent b6d3b5d commit 2ff071c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: 2.1

jobs:
run-tests:
docker:
Expand Down Expand Up @@ -35,7 +36,15 @@ jobs:
snyk monitor --org=auth0-sdks
fi
when: always

publish:
docker:
- image: cimg/ruby:2.7
steps:
- checkout
- run:
name: Build and publish gem to gemfury
command: ./.circleci/publish.sh

workflows:
tests:
jobs:
Expand All @@ -48,3 +57,14 @@ workflows:
context: snyk-env
requires:
- run-tests
- publish:
requires:
- run-tests
context:
- dod-pypi
filters:
# only publish gem after cutting tag
tags:
only: /.*/
branches:
ignore: /.*/
17 changes: 17 additions & 0 deletions .circleci/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -euo pipefail

if [ -z "$GEMFURY_PUSH_TOKEN" ]; then
echo 'Environment variable GEMFURY_PUSH_TOKEN must be specified. Aborting.'
exit 1
fi

for file in `ls *.gemspec`; do
gem build $file
done

# Publish to Gemfury (based on: https://gemfury.com/help/upload-packages/#cURL)
for file in `ls *.gem`; do
echo "Publishing new package version: ${file}"
curl --fail -F package=@${file} https://${GEMFURY_PUSH_TOKEN}@push.fury.io/doctorondemand/
done
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,16 @@ Auth0 helps you to easily:
## License

The OmniAuth Auth0 strategy is licensed under MIT - [LICENSE](LICENSE)

## How to Create a Release

Releases happen in CircleCI when a tag is pushed to the repository.

To create a release, you will need to do the following:

1. Change the version in `lib/omniauth-auth0/version.rb` to the new version and create a PR with the change.
1. Once the PR is merged, switch to the master branch and `git pull`.
1. `git tag <version from version.rb>`
1. `git push origin --tags`

CircleCI will see the tag push, build, and release a new version of the library.

0 comments on commit 2ff071c

Please sign in to comment.