Skip to content

attempt to fix rubygem publishing #32

attempt to fix rubygem publishing

attempt to fix rubygem publishing #32

Workflow file for this run

name: ci
on:
push:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2']
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Install dependencies
run: bundle install
- name: Run tests
run: rspec .
publish:
name: Build and publish gem
if: github.ref == 'refs/heads/main' && needs.test.result == 'success'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Publish to GPR
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
curl -u $RUBYGEMS_USERNAME:$RUBYGEMS_PASSWORD https://rubygems.org/api/v1/api_key.yaml > $HOME/.gem/credentials; chmod 0600 $HOME/.gem/credentials
gem build arxiv.gemspec
gem push `ls | grep *.gem`
env:
RUBYGEMS_USERNAME: "${{ secrets.RUBYGEMS_USERNAME }}"
RUBYGEMS_PASSWORD: "${{ secrets.RUBYGEMS_PASSWORD }}"