Skip to content

Commit

Permalink
chore: bring in latest v15 changes (#97)
Browse files Browse the repository at this point in the history
* feat: run support

* fix: tests:

* chore: delete generate

* chore: rename action

* remove compile step deps

* change docker image

* change docker image

* dont get docversion

* comment

* get workflow file better

* load langs correctly

* load langs from workflow always

* properly get releases dir

* nil check

* Update workflow-executor.yaml

* remove publish checks

* remove more publish_* inputs

* print publish?

* explicitly set node version

* different log

* tidy

* new ispublished

* update sdk gen config dep

* setup-node v4

* run node

* add python step

* install all lang deps for compilation

* install in dockerfile rather than workflow

* use apk instead of apt-get

* move deps to deploy instead of build

* python3.8

* python3.8 copy

* python3.8 3

* python38

* add other stuff to dockerfile

* python38 -> python3

* php7 -> php

* big php2

* add ruby-dev

* add dotnet

* add build-base for ruby

* use new map flags

* check output after run

* better installation urls

* improve action

* remove finalize step

* remove finalize step really this time

* clean up unused codepaths

* better publish deps

* support new java publishing

* build first

* manual git add

* remove test.go

* run git directly

* install .NET5 alongside .NET6

* fix: v15-release still pointing to forked repository

* remove redundant apk add commands

* fix: pull correct docker image

* chore: remove unneeded publish inputs

* fix: correct output locations

* chore: remove create_release everywhere

* fix: dont check langs

* fix: install php-xml

* fix: add all php deps

* feat: monorepo release support

* install libssl1 for .NET5 compilation

* feat: fix no sdk generated

* feat: v15 explain workflow perms

* feat: v15 explain workflow perms

* feat: better workflow permissions actions

* fix: add python3-dev dep to dockerfile

* Merge branch 'main' into v15-release

---------

Co-authored-by: Robert Crumbaugh <chasecrumbaugh4@gmail.com>
Co-authored-by: Qynn Schwaab <qynn@commonsense.dev>
Co-authored-by: Qynn Schwaab <41802320+2ynn@users.noreply.github.com>
Co-authored-by: Ryan Albert <ryantimalbert@gmail.com>
Co-authored-by: Ryan Albert <42415738+ryan-timothy-albert@users.noreply.github.com>
  • Loading branch information
6 people authored Mar 22, 2024
1 parent 77a3219 commit 50361b7
Show file tree
Hide file tree
Showing 25 changed files with 924 additions and 1,951 deletions.
3 changes: 1 addition & 2 deletions .github/actionconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const (
publishIdentifier = "publish_"
inputConfigKey = "inputs"
securityConfigKey = "secrets"
createRelease = "create_release"
schemaTokenKey = "openapi_doc_auth_token"
)

Expand All @@ -42,7 +41,7 @@ func GenerateActionInputsConfig() (*SDKGenConfig, error) {
}

for _, inputConfigField := range inputConfigFields {
if strings.Contains(inputConfigField.Name, publishIdentifier) || inputConfigField.Name == createRelease {
if strings.Contains(inputConfigField.Name, publishIdentifier) {
reqForPublishing := true
inputConfigField.RequiredForPublishing = &reqForPublishing
if inputConfigField.Language != nil && *inputConfigField.Language != "" {
Expand Down
1,270 changes: 0 additions & 1,270 deletions .github/workflows/sdk-generation.yaml

Large diffs are not rendered by default.

82 changes: 18 additions & 64 deletions .github/workflows/sdk-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,6 @@ name: Speakeasy SDK Publish Workflow
on:
workflow_call:
inputs:
create_release:
description: "Create a Github release"
default: "true"
required: false
type: string
publish_python:
description: "Publish the Python SDK to PyPi if using 'direct' mode or prepare a release if using 'pr' mode"
default: "false"
required: false
type: string
publish_typescript:
description: "Publish the Typescript SDK to NPM if using 'direct' mode or prepare a release if using 'pr' mode"
default: "false"
required: false
type: string
publish_java:
description: "Publish the Java SDK to the OSSRH URL configured in gen.yml if using 'direct' mode or prepare a release if using 'pr' mode"
default: "false"
required: false
type: string
use_sonatype_central:
description: "When publishing the Java SDK, use the Sonatype central portal"
default: "false"
required: false
type: string
publish_php:
description: "Publish the PHP SDK for Composer if using 'direct' mode or prepare a release if using 'pr' mode"
default: "false"
required: false
type: string
publish_ruby:
description: "Publish the Ruby SDK for RubyGems if using 'direct' mode or prepare a release if using 'pr' mode"
default: "false"
required: false
type: string
publish_csharp:
description: "Publish the C# SDK for nuget if using 'direct' mode or prepare a release if using 'pr' mode"
default: "false"
required: false
type: string
publish_terraform:
description: "Create a Github release compatible with the terraform registry of the provider"
default: "false"
required: false
type: string
speakeasy_server_url:
required: false
description: "Internal use only"
Expand Down Expand Up @@ -102,6 +57,13 @@ jobs:
name: Create Github Release
runs-on: ubuntu-latest
outputs:
publish_python: ${{ steps.release.outputs.publish_python }}
publish_typescript: ${{ steps.release.outputs.publish_typescript }}
publish_terraform: ${{ steps.release.outputs.publish_terraform }}
publish_java: ${{ steps.release.outputs.publish_java }}
publish_php: ${{ steps.release.outputs.publish_php }}
publish_ruby: ${{ steps.release.outputs.publish_ruby }}
publish_csharp: ${{ steps.release.outputs.publish_csharp }}
python_regenerated: ${{ steps.release.outputs.python_regenerated }}
python_directory: ${{ steps.release.outputs.python_directory }}
typescript_regenerated: ${{ steps.release.outputs.typescript_regenerated }}
Expand All @@ -124,17 +86,9 @@ jobs:
- name: Tune GitHub-hosted runner network
uses: smorimoto/tune-github-hosted-runner-network@v1
- id: release
uses: speakeasy-api/sdk-generation-action@v14
uses: speakeasy-api/sdk-generation-action@v15
with:
github_access_token: ${{ secrets.github_access_token }}
create_release: ${{ inputs.create_release }}
publish_python: ${{ inputs.publish_python }}
publish_typescript: ${{ inputs.publish_typescript }}
publish_terraform: ${{ inputs.publish_terraform }}
publish_java: ${{ inputs.publish_java }}
publish_php: ${{ inputs.publish_php }}
publish_ruby: ${{ inputs.publish_ruby }}
publish_csharp: ${{ inputs.publish_csharp }}
action: "release"
speakeasy_api_key: ${{ secrets.speakeasy_api_key }}
speakeasy_server_url: ${{ inputs.speakeasy_server_url }}
Expand All @@ -150,7 +104,7 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
publish-pypi:
if: ${{ needs.release.outputs.python_regenerated == 'true' && inputs.publish_python == 'true' }}
if: ${{ needs.release.outputs.python_regenerated == 'true' && needs.release.outputs.publish_python == 'true' }}
name: Publish Python SDK
runs-on: ubuntu-latest
needs: release
Expand Down Expand Up @@ -188,7 +142,7 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
publish-npm:
if: ${{ needs.release.outputs.typescript_regenerated == 'true' && inputs.publish_typescript == 'true' }}
if: ${{ needs.release.outputs.typescript_regenerated == 'true' && needs.release.outputs.publish_typescript == 'true' }}
name: Publish Typescript SDK
runs-on: ubuntu-latest
needs: release
Expand Down Expand Up @@ -222,7 +176,7 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
publish-java:
if: ${{ needs.release.outputs.java_regenerated == 'true' && inputs.publish_java == 'true' }}
if: ${{ needs.release.outputs.java_regenerated == 'true' && needs.release.outputs.publish_java == 'true' }}
name: Publish Java SDK
runs-on: ubuntu-latest
needs: release
Expand All @@ -243,7 +197,7 @@ jobs:
run: |-
pwd
./gradlew publish --no-daemon
if: ${{ inputs.use_sonatype_central != 'true' }}
if: ${{ needs.release.outputs.use_sonatype_legacy == 'true' }}
env:
MAVEN_USERNAME: ${{ secrets.ossrh_username }}
MAVEN_PASSWORD: ${{ secrets.ossrh_password }}
Expand All @@ -253,7 +207,7 @@ jobs:
run: |-
pwd
./gradlew build sonatypeCentralUpload --no-daemon
if: ${{ inputs.use_sonatype_central == 'true' }}
if: ${{ needs.release.outputs.use_sonatype_legacy != 'true' }}
env:
SONATYPE_USERNAME: ${{ secrets.ossrh_username }}
SONATYPE_PASSWORD: ${{ secrets.ossrh_password }}
Expand All @@ -271,7 +225,7 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
publish-packagist:
if: ${{ needs.release.outputs.php_regenerated == 'true' && inputs.publish_php == 'true' }}
if: ${{ needs.release.outputs.php_regenerated == 'true' && needs.release.outputs.publish_php == 'true' }}
name: Publish PHP SDK
runs-on: ubuntu-latest
needs: release
Expand Down Expand Up @@ -300,7 +254,7 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
publish-nuget:
if: ${{ needs.release.outputs.csharp_regenerated == 'true' && inputs.publish_csharp == 'true' }}
if: ${{ needs.release.outputs.csharp_regenerated == 'true' && needs.release.outputs.publish_csharp == 'true' }}
name: Publish C# SDK
runs-on: ubuntu-latest
needs: release
Expand Down Expand Up @@ -329,7 +283,7 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
publish-terraform:
if: ${{ needs.release.outputs.terraform_regenerated == 'true' && inputs.publish_terraform == 'true' }}
if: ${{ needs.release.outputs.terraform_regenerated == 'true' && needs.release.outputs.publish_terraform == 'true' }}
name: Publish Terraform Provider
runs-on: ubuntu-latest
needs: release
Expand All @@ -347,7 +301,7 @@ jobs:
gpg_private_key: ${{ secrets.TERRAFORM_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.TERRAFORM_GPG_PASSPHRASE }}
- id: release
uses: speakeasy-api/sdk-generation-action@v14
uses: speakeasy-api/sdk-generation-action@v15
with:
github_access_token: ${{ secrets.github_access_token }}
speakeasy_api_key: ${{ secrets.speakeasy_api_key }}
Expand All @@ -368,7 +322,7 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
publish-gems:
if: ${{ needs.release.outputs.ruby_regenerated == 'true' && inputs.publish_ruby == 'true' }}
if: ${{ needs.release.outputs.ruby_regenerated == 'true' && needs.release.outputs.publish_ruby == 'true' }}
name: Publish Ruby SDK
runs-on: ubuntu-latest
needs: release
Expand Down
Loading

0 comments on commit 50361b7

Please sign in to comment.