diff --git a/.github/actionconfig.go b/.github/actionconfig.go index 199048de..ab9a4663 100644 --- a/.github/actionconfig.go +++ b/.github/actionconfig.go @@ -15,7 +15,6 @@ const ( publishIdentifier = "publish_" inputConfigKey = "inputs" securityConfigKey = "secrets" - createRelease = "create_release" schemaTokenKey = "openapi_doc_auth_token" ) @@ -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 != "" { diff --git a/.github/workflows/sdk-publish.yaml b/.github/workflows/sdk-publish.yaml index 9d5120c1..8bfe5a11 100644 --- a/.github/workflows/sdk-publish.yaml +++ b/.github/workflows/sdk-publish.yaml @@ -3,11 +3,6 @@ name: Speakeasy SDK Publish Workflow on: workflow_call: inputs: - create_release: - description: "Create a Github release" - default: "true" - required: false - type: string speakeasy_server_url: required: false description: "Internal use only" @@ -94,7 +89,6 @@ jobs: uses: speakeasy-api/sdk-generation-action@v15 with: github_access_token: ${{ secrets.github_access_token }} - create_release: ${{ inputs.create_release }} action: "release" speakeasy_api_key: ${{ secrets.speakeasy_api_key }} speakeasy_server_url: ${{ inputs.speakeasy_server_url }} diff --git a/.github/workflows/workflow-executor.yaml b/.github/workflows/workflow-executor.yaml index 95918905..1e15c7db 100644 --- a/.github/workflows/workflow-executor.yaml +++ b/.github/workflows/workflow-executor.yaml @@ -127,7 +127,6 @@ jobs: with: speakeasy_version: ${{ inputs.speakeasy_version }} github_access_token: ${{ secrets.github_access_token }} - create_release: ${{ inputs.create_release }} mode: ${{ inputs.mode }} force: ${{ inputs.force }} speakeasy_api_key: ${{ secrets.speakeasy_api_key }} diff --git a/README.md b/README.md index 8c4522b5..6a537560 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,6 @@ jobs: uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v14 # Import the sdk publish workflow which will handle the publishing to the package managers with: publish_python: true # Tells the publish action to publish the Python SDK to PyPi - create_release: true secrets: github_access_token: ${{ secrets.GITHUB_TOKEN }} pypi_token: ${{ secrets.PYPI_TOKEN }} @@ -253,8 +252,6 @@ Distribution of Swift SDKs is supported using the [Swift Package Manager](https: As such publishing a Swift package through the action creates a new git tag (and corresponding GitHub release) which allows the SDK to be easily imported into Swift projects by the GitHub repository's URL and corresponding version. -**Note:** Because of the requirement on git tags and GitHub releases, the value of `create_release` is ignored when publishing a Swift SDK through the action. - ### Terraform Registry Publishing a generated terraform provider is possible through the configuration of this action. In order to publish, you must do the following: @@ -309,7 +306,7 @@ The action to run, valid options are `validate`, `generate`, `finalize`, `sugges The mode to run the action in, valid options are `direct` or `pr`, defaults to `direct`. -- `direct` will create a commit with the changes to the SDKs and push them directly to the branch the workflow is configure to run on (normally 'main' or 'master'). If `create_release` is `true` this will happen immediately after the commit is created on the branch. +- `direct` will create a commit with the changes to the SDKs and push them directly to the branch the workflow is configure to run on (normally 'main' or 'master'). - `pr` will instead create a new branch to commit the changes to the SDKs to and then create a PR from this branch. The sdk-publish workflow will then need to be configured to run when the PR is merged to publish the SDKs and create a release. ### `speakeasy_version` @@ -391,11 +388,6 @@ languages: | If multiple languages are present we will treat the repo as a mono repo, if a single language is present as a single language repo. -### `create_release` - -Whether to create a release for the new SDK version if using `direct` mode. Default `"true"`. -This will also create a tag for the release, allowing the Go SDK to be retrieved via a tag with Go modules. - ### `publish_python` **(Workflow Only)** Whether to publish the Python SDK to PyPi. Default `"false"`. diff --git a/action.yml b/action.yml index 68403e4e..a3bb1302 100644 --- a/action.yml +++ b/action.yml @@ -143,7 +143,6 @@ runs: - ${{ inputs.speakeasy_version }} - ${{ inputs.github_access_token }} - ${{ inputs.docs_languages }} - - ${{ inputs.create_release }} - ${{ inputs.max_suggestions }} - ${{ inputs.mode }} - ${{ inputs.action }} diff --git a/internal/environment/environment.go b/internal/environment/environment.go index f6a06573..1dc03ae9 100644 --- a/internal/environment/environment.go +++ b/internal/environment/environment.go @@ -141,7 +141,7 @@ func IsDocsGeneration() bool { } func CreateGitRelease() bool { - return os.Getenv("INPUT_CREATE_RELEASE") == "true" || IsLanguagePublished("php") || IsLanguagePublished("terraform") || IsLanguagePublished("swift") + return IsLanguagePublished("php") || IsLanguagePublished("terraform") || IsLanguagePublished("swift") } func GetAccessToken() string { @@ -158,7 +158,7 @@ func GetInvokeTime() time.Time { func IsLanguagePublished(lang string) bool { if lang == "go" || lang == "swift" { - return os.Getenv("INPUT_CREATE_RELEASE") == "true" + return true } return os.Getenv(fmt.Sprintf("INPUT_PUBLISH_%s", strings.ToUpper(lang))) == "true" diff --git a/testing/direct-mode-multi-sdk.env b/testing/direct-mode-multi-sdk.env index 35c8290b..ff66e622 100644 --- a/testing/direct-mode-multi-sdk.env +++ b/testing/direct-mode-multi-sdk.env @@ -1,7 +1,6 @@ INPUT_MODE="direct" INPUT_ACTION="generate" INPUT_LANGUAGES="- go: ./subsdk1" -INPUT_CREATE_RELEASE=true GITHUB_REPOSITORY="speakeasy-api/sdk-generation-action-multi-test-repo" INPUT_FORCE=true RUN_FINALIZE=true \ No newline at end of file diff --git a/testing/direct-mode.env b/testing/direct-mode.env index ffd70dea..708de6b6 100644 --- a/testing/direct-mode.env +++ b/testing/direct-mode.env @@ -1,7 +1,6 @@ INPUT_MODE="direct" INPUT_ACTION="generate" INPUT_LANGUAGES="- go" -INPUT_CREATE_RELEASE=true GITHUB_REPOSITORY="speakeasy-api/sdk-generation-action-test-repo" INPUT_FORCE=true RUN_FINALIZE=true \ No newline at end of file diff --git a/testing/release-mode-multi-sdk.env b/testing/release-mode-multi-sdk.env index 67f45b5b..68f4347a 100644 --- a/testing/release-mode-multi-sdk.env +++ b/testing/release-mode-multi-sdk.env @@ -1,4 +1,3 @@ INPUT_ACTION="release" INPUT_LANGUAGES="- go: ./subsdk1" -INPUT_CREATE_RELEASE=true GITHUB_REPOSITORY="speakeasy-api/sdk-generation-action-multi-test-repo" diff --git a/testing/release-mode.env b/testing/release-mode.env index 94c7a42a..b8c7822f 100644 --- a/testing/release-mode.env +++ b/testing/release-mode.env @@ -1,4 +1,3 @@ INPUT_ACTION="release" INPUT_LANGUAGES="- go" -INPUT_CREATE_RELEASE=true GITHUB_REPOSITORY="speakeasy-api/sdk-generation-action-test-repo" \ No newline at end of file