Skip to content

Commit

Permalink
PHP - update and publish SDK once the generator is GA (#6)
Browse files Browse the repository at this point in the history
* update gen.yaml to be as similar as possible to other repos

* changes from speakeasy publish automation

* update workflow docs

* udpate workflows more

* revert removing permissions from validation

* manual updates to README

* add logo

* update readme and gen yaml for beta version release

* set version to alpha

* update workflows for secret name change

* testing generate action
  • Loading branch information
rkeur7 authored Nov 12, 2024
1 parent dbef6fe commit 5f88a6d
Show file tree
Hide file tree
Showing 6 changed files with 207 additions and 110 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/sdk_generation.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
name: Generate

permissions:
checks: write
contents: write
pull-requests: write
statuses: write
"on":

on:
workflow_dispatch:
inputs:
force:
description: Force generation of SDKs
type: boolean
default: false
schedule:
- cron: 0 0 * * *
- cron: "0 0 * * 1" # Mondays at 00:00 UTC

jobs:
generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
Expand All @@ -22,4 +25,5 @@ jobs:
speakeasy_version: latest
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_PHP_API_KEY }}
packagist_token: ${{ secrets.PACKAGIST_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_PHP_API_KEY }}
23 changes: 23 additions & 0 deletions .github/workflows/sdk_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish

permissions:
checks: write
contents: write
pull-requests: write
statuses: write

on:
push:
branches:
- main
paths:
- RELEASES.md
- "*/RELEASES.md"

jobs:
publish:
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
packagist_token: ${{ secrets.PACKAGIST_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_PHP_API_KEY }}
27 changes: 23 additions & 4 deletions .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
configVersion: 2.0.0
generation:
sdkClassName: ShippoSDK
sdkClassName: Shippo
maintainOpenAPIOrder: true
usageSnippets:
optionalPropertyRendering: withExample
Expand All @@ -11,8 +11,19 @@ generation:
requestResponseComponentNamesFeb2024: true
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
externalDocs:
version: ""
url: https://github.com/goshippo/shippo-php-sdk
info:
version: ""
description: Packagist library which integrates with Shippo Multi Carrier Shipping API. This library provides access to Shippo (goshippo.com) API capabilities. Including label generation, rating, tracking and more.
php:
version: 0.0.2
version: 3.0.0-alpha
author: Shippo
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKError
description: Shipping API Python library (USPS, FedEx, UPS and more)
flattenGlobalSecurity: true
imports:
option: openapi
Expand All @@ -23,7 +34,15 @@ php:
shared: Models/Components
webhooks: Models/Webhooks
inputModelSuffix: input
maxMethodParams: 4
laravelServiceProvider:
enabled: false
svcName: openapi
license: MIT License
maxMethodParams: 3
namespace: Shippo\API
outputModelSuffix: output
packageName: shippo/api
packageName: shippo/shippo-php
packageTags: USPS Fedex UPS API Shippo
projectUrls: {}
responseFormat: flat
templateVersion: v1
6 changes: 5 additions & 1 deletion .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ sources:
registry:
location: registry.speakeasyapi.dev/shippo/shippo/openapi
targets:
my-first-target:
php:
target: php
source: openapi
publish:
packagist:
username: [email protected]
token: $packagist_token
Loading

0 comments on commit 5f88a6d

Please sign in to comment.