-
Notifications
You must be signed in to change notification settings - Fork 110
40 lines (40 loc) · 1.67 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Release
on:
workflow_run:
workflows: [Test]
types: [completed]
branches: [master, main]
workflow_dispatch: # allow manual deployment through GitHub Action UI
jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- name: Version file changed
id: version-file-changed
uses: tj-actions/changed-files@v42
with:
files: lib/blueprinter/version.rb
- name: Set up Ruby
if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: Installing dependencies
if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
- name: Build gem file
if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
run: bundle exec rake build
- uses: fac/ruby-gem-setup-credentials-action@v2
if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
with:
user: ""
key: rubygems
token: ${{secrets.RUBY_GEMS_API_KEY}}
- uses: fac/ruby-gem-push-action@v2
if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
with:
key: rubygems