Skip to content

Commit

Permalink
chore: remove create_release everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
chase-crumbaugh committed Feb 27, 2024
1 parent 8666e75 commit bf21a8f
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 25 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
6 changes: 0 additions & 6 deletions .github/workflows/sdk-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/workflow-executor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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"`.
Expand Down
1 change: 0 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions internal/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"
Expand Down
1 change: 0 additions & 1 deletion testing/direct-mode-multi-sdk.env
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion testing/direct-mode.env
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion testing/release-mode-multi-sdk.env
Original file line number Diff line number Diff line change
@@ -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"
1 change: 0 additions & 1 deletion testing/release-mode.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
INPUT_ACTION="release"
INPUT_LANGUAGES="- go"
INPUT_CREATE_RELEASE=true
GITHUB_REPOSITORY="speakeasy-api/sdk-generation-action-test-repo"

0 comments on commit bf21a8f

Please sign in to comment.