Repository navigation
feat: variables testing in Ruby (#7) #9
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: Publish to RubyGems | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: publish-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.4" | |
| bundler-cache: true | |
| - name: Test both packages | |
| run: make test | |
| - name: Build and verify both gem artifacts | |
| run: make build | |
| - name: Verify tag matches package version | |
| id: version | |
| shell: bash | |
| run: | | |
| version="$(bundle exec ruby -Ilib -rfeaturevisor/version -e 'print Featurevisor::VERSION')" | |
| if [ "$GITHUB_REF_NAME" != "v$version" ]; then | |
| echo "Tag $GITHUB_REF_NAME does not match gem version $version" >&2 | |
| exit 1 | |
| fi | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| - name: Publish Featurevisor SDK | |
| env: | |
| GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
| run: gem push "featurevisor-${{ steps.version.outputs.version }}.gem" | |
| - name: Publish Featurevisor OpenFeature provider | |
| env: | |
| GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
| run: gem push "featurevisor-openfeature-${{ steps.version.outputs.version }}.gem" |