Skip to content
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
56 changes: 3 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,14 @@ name: CI
on:
push:
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
- main
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
build:
timeout-minutes: 10
name: build
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/cloudpayments-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: |-
github.repository == 'stainless-sdks/cloudpayments-ruby' &&
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
- run: |-
bundle install

- name: Get GitHub OIDC Token
if: |-
github.repository == 'stainless-sdks/cloudpayments-ruby' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Build and upload gem artifacts
if: |-
github.repository == 'stainless-sdks/cloudpayments-ruby' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
PACKAGE_NAME: cloudpayments_ruby
run: ./scripts/utils/upload-artifact.sh
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/cloudpayments-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
Expand All @@ -73,8 +24,7 @@ jobs:
test:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/cloudpayments-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release Please
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
name: release-please
runs-on: ubuntu-latest
if: github.repository == 'Hexlet/cloudpayments-ruby'
steps:
- uses: googleapis/release-please-action@v4
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
4 changes: 2 additions & 2 deletions lib/cloudpayments_ruby/models/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class Subscription < CloudpaymentsRuby::Internal::Type::BaseModel
# Максимальное количество платежей
#
# @return [Integer, nil]
optional :max_periods, Integer, api_name: :MaxPeriods
optional :max_periods, Integer, api_name: :MaxPeriods, nil?: true

# @!attribute next_transaction_date
# Дата следующей транзакции
Expand Down Expand Up @@ -200,7 +200,7 @@ class Subscription < CloudpaymentsRuby::Internal::Type::BaseModel
#
# @param last_transaction_date_iso [String] Дата последней транзакции ISO
#
# @param max_periods [Integer] Максимальное количество платежей
# @param max_periods [Integer, nil] Максимальное количество платежей
#
# @param next_transaction_date [String] Дата следующей транзакции
#
Expand Down
6 changes: 3 additions & 3 deletions rbi/cloudpayments_ruby/models/subscription.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module CloudpaymentsRuby
sig { returns(T.nilable(Integer)) }
attr_reader :max_periods

sig { params(max_periods: Integer).void }
sig { params(max_periods: T.nilable(Integer)).void }
attr_writer :max_periods

# Дата следующей транзакции
Expand Down Expand Up @@ -162,7 +162,7 @@ module CloudpaymentsRuby
failover_scheme_id: String,
last_transaction_date: String,
last_transaction_date_iso: String,
max_periods: Integer,
max_periods: T.nilable(Integer),
next_transaction_date: String,
next_transaction_date_iso: String,
receipt: T.anything
Expand Down Expand Up @@ -246,7 +246,7 @@ module CloudpaymentsRuby
failover_scheme_id: String,
last_transaction_date: String,
last_transaction_date_iso: String,
max_periods: Integer,
max_periods: T.nilable(Integer),
next_transaction_date: String,
next_transaction_date_iso: String,
receipt: T.anything
Expand Down
6 changes: 2 additions & 4 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
"packages": {
".": {}
},
"$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-v-in-tag": true,
"include-component-in-tag": false,
"versioning": "prerelease",
"prerelease": true,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"pull-request-header": "Automated Release PR",
Expand Down Expand Up @@ -63,7 +61,7 @@
"version-file": "lib/cloudpayments_ruby/version.rb",
"extra-files": [
{
"type": "ruby-readme",
"type": "generic",
"path": "README.md"
}
]
Expand Down
8 changes: 4 additions & 4 deletions sig/cloudpayments_ruby/models/subscription.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module CloudpaymentsRuby
failover_scheme_id: String,
last_transaction_date: String,
last_transaction_date_iso: String,
max_periods: Integer,
max_periods: Integer?,
next_transaction_date: String,
next_transaction_date_iso: String,
receipt: top
Expand Down Expand Up @@ -84,7 +84,7 @@ module CloudpaymentsRuby

attr_reader max_periods: Integer?

def max_periods=: (Integer) -> Integer
def max_periods=: (Integer?) -> Integer?

attr_reader next_transaction_date: String?

Expand Down Expand Up @@ -120,7 +120,7 @@ module CloudpaymentsRuby
?failover_scheme_id: String,
?last_transaction_date: String,
?last_transaction_date_iso: String,
?max_periods: Integer,
?max_periods: Integer?,
?next_transaction_date: String,
?next_transaction_date_iso: String,
?receipt: top
Expand Down Expand Up @@ -148,7 +148,7 @@ module CloudpaymentsRuby
failover_scheme_id: String,
last_transaction_date: String,
last_transaction_date_iso: String,
max_periods: Integer,
max_periods: Integer?,
next_transaction_date: String,
next_transaction_date_iso: String,
receipt: top
Expand Down