Release #95
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: Release | |
on: | |
workflow_run: | |
workflows: [Test] | |
types: [completed] | |
branches: [main] | |
workflow_dispatch: # allow manual deployment through GitHub Action UI | |
jobs: | |
version-check: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
outputs: | |
changed: ${{ steps.check.outputs.any_changed }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Check if version has been updated | |
id: check | |
uses: tj-actions/changed-files@d6babd6899969df1a11d14c368283ea4436bca78 # v44 | |
with: | |
files: lib/blueprinter/version.rb | |
release: | |
runs-on: ubuntu-latest | |
needs: version-check | |
if: ${{ github.event_name == 'workflow_dispatch' || needs.version-check.outputs.changed == 'true' }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@ff740bc00a01b3a50fffc55a1071b1060eeae9dc # v1 | |
with: | |
ruby-version: 3.2 | |
bundler-cache: true | |
- name: Installing dependencies | |
run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle | |
- name: Build gem file | |
run: bundle exec rake build | |
- uses: fac/ruby-gem-setup-credentials-action@5f62d5f2f56a11c7422a92f81fbb29af01e1c00f # v2 | |
with: | |
user: "" | |
key: rubygems | |
token: ${{secrets.RUBY_GEMS_API_KEY}} | |
- uses: fac/ruby-gem-push-action@81d77bf568ff6659d7fae0f0c5a036bb0aeacb1a # v2 | |
with: | |
key: rubygems |