Skip to content

Commit

Permalink
fix: change release github action to use different actions
Browse files Browse the repository at this point in the history
Signed-off-by: jmeridth <[email protected]>
  • Loading branch information
jmeridth committed Aug 22, 2023
1 parent d23441f commit f00a4a3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,32 @@ on:
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.workflow_run.conclusion == 'success' }}
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5 # (latest, untagged)
- name: Version file changed
id: version-file-changed
uses: tj-actions/changed-files@87697c0dca7dd44e37a2b79a79489332556ff1f3 # (latest, untagged)
with:
files: lib/blueprinter/version.rb
- name: Release New Gem Version
if: ${{ steps.version-file-changed.outputs.any_changed == 'true' }}
uses: cadwallion/publish-rubygems-action@94a6f4cd5350581749c569b5001eecc864e3ad0b # (latest, untagged)
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
RUBYGEMS_API_KEY: ${{secrets.RUBY_GEMS_API_KEY}}
RELEASE_COMMAND: bundle exec rake release || true # Don't fail when deploy does not take place
- name: Set up Ruby
if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # (latest, untagged)
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
- uses: fac/ruby-gem-setup-credentials-action@5f62d5f2f56a11c7422a92f81fbb29af01e1c00f # (latest, untagged)
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@81d77bf568ff6659d7fae0f0c5a036bb0aeacb1a # (latest, untagged)
if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5 # (latest, untagged)
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # (latest, untagged)
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
Expand Down

0 comments on commit f00a4a3

Please sign in to comment.