Require gem_tasks #4
Workflow file for this run
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: Publish Gem | |
on: [push] | |
env: | |
BUNDLE_SAGEONEGEMS__JFROG__IO: ${{ secrets.BUNDLE_SAGEONEGEMS__JFROG__IO }} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.4 | |
bundler-cache: true | |
- name: Run tests | |
run: bundle exec rspec | |
- name: Code Coverage | |
uses: paambaati/codeclimate-action@v2.7.5 | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
with: | |
coverageLocations: | | |
${{github.workspace}}/coverage/.resultset.json:simplecov | |
release: | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/build-') | |
name: Build and Publish gem | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby 2.7 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7 | |
bundler-cache: true | |
- run: bundle exec rake build class_kit.gemspec | |
- name: Publish to JFrog | |
run: | | |
mkdir -p $HOME/.gem | |
curl -u $JFROG_USER:$JFROG_PASS $RUBYGEMS_HOST/api/v1/api_key.yaml > $HOME/.gem/credentials | |
chmod 0600 $HOME/.gem/credentials | |
gem push $GEMS_PATH | |
env: | |
JFROG_USER: "${{secrets.JFROG_USER}}" | |
JFROG_PASS: "${{secrets.JFROG_PASS}}" | |
RUBYGEMS_HOST: "https://sageonegems.jfrog.io/sageonegems/api/gems/gems-local" | |
GEMS_PATH: "pkg/*.gem" |