Repository navigation
v0.1.4 #2
Workflow file for this run
This file contains hidden or 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: release | |
| # Publishes to RubyGems when a GitHub Release is published, i.e. by `npm run release` | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag to publish, e.g. v0.1.3' | |
| required: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ github.event.inputs.tag || github.ref }} | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.4' | |
| bundler-cache: true | |
| - name: Verify the gem version matches the release tag | |
| run: | | |
| TAG="${{ github.event.inputs.tag || github.ref_name }}" | |
| VERSION=$(ruby -Ilib -e "require 'servicestack/version'; print ServiceStack::VERSION") | |
| if [ "v$VERSION" != "$TAG" ]; then | |
| echo "lib/servicestack/version.rb is v$VERSION but the release tag is $TAG" | |
| exit 1 | |
| fi | |
| - name: rake test | |
| run: bundle exec rake test | |
| - name: gem push | |
| run: | | |
| gem build servicestack.gemspec | |
| gem push servicestack-*.gem | |
| env: | |
| GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} |