Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: simplify release GitHub Action #70

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @procore-oss/procore-ospo @procore-oss/procore-ruby-sdk
* @procore-oss/procore-ospo @procore-oss/procore-api
19 changes: 11 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,38 @@ on:
branches: [main]
workflow_dispatch: # allow manual deployment through GitHub Action UI
jobs:
release:
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@v4
- name: Version file changed
id: version-file-changed
- name: Check if version has been updated
id: check
uses: tj-actions/changed-files@v42
with:
files: lib/procore/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@v4
- 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 install
- 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