From 2bb768273dd551c1b4a025558df7fd13a5216411 Mon Sep 17 00:00:00 2001 From: Robert Crumbaugh Date: Fri, 9 Feb 2024 10:18:59 -0800 Subject: [PATCH] better publish deps --- .github/workflows/workflow-executor.yaml | 42 ++++++++++++++++++++---- internal/cli/cli.go | 2 +- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/.github/workflows/workflow-executor.yaml b/.github/workflows/workflow-executor.yaml index bdf674db..5ab07ac1 100644 --- a/.github/workflows/workflow-executor.yaml +++ b/.github/workflows/workflow-executor.yaml @@ -161,7 +161,12 @@ jobs: GH_ACTION_VERSION: "v14" GH_ACTION_STEP: ${{ github.job }} publish-pypi: - if: ${{ always() && needs.run-workflow.outputs.python_regenerated == 'true' && needs.run-workflow.outputs.publish_python == 'true' && inputs.mode != 'pr' }} + if: ${{ always() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + needs.run-workflow.outputs.python_regenerated == 'true' && + needs.run-workflow.outputs.publish_python == 'true' + && inputs.mode != 'pr' }} name: Publish Python SDK runs-on: ubuntu-latest needs: [ run-workflow ] @@ -215,7 +220,12 @@ jobs: GH_ACTION_STEP: ${{ github.job }} TARGET_TYPE: "sdk" publish-npm: - if: ${{ always() && needs.run-workflow.outputs.typescript_regenerated == 'true' && needs.run-workflow.outputs.publish_typescript == 'true' && inputs.mode != 'pr' }} + if: ${{ always() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + needs.run-workflow.outputs.typescript_regenerated == 'true' && + needs.run-workflow.outputs.publish_typescript == 'true' + && inputs.mode != 'pr' }} name: Publish Typescript SDK runs-on: ubuntu-latest needs: [ run-workflow ] @@ -265,7 +275,12 @@ jobs: GH_ACTION_STEP: ${{ github.job }} TARGET_TYPE: "sdk" publish-java: - if: ${{ always() && needs.run-workflow.outputs.java_regenerated == 'true' && needs.run-workflow.outputs.publish_java == 'true' && inputs.mode != 'pr' }} + if: ${{ always() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + needs.run-workflow.outputs.java_regenerated == 'true' && + needs.run-workflow.outputs.publish_java == 'true' + && inputs.mode != 'pr' }} name: Publish Java SDK runs-on: ubuntu-latest needs: [ run-workflow ] @@ -320,7 +335,12 @@ jobs: GH_ACTION_STEP: ${{ github.job }} TARGET_TYPE: "sdk" publish-gems: - if: ${{ always() && needs.run-workflow.outputs.ruby_regenerated == 'true' && needs.run-workflow.outputs.publish_ruby == 'true' && inputs.mode != 'pr' }} + if: ${{ always() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + needs.run-workflow.outputs.ruby_regenerated == 'true' && + needs.run-workflow.outputs.publish_ruby == 'true' + && inputs.mode != 'pr' }} name: Publish Ruby SDK runs-on: ubuntu-latest needs: [ run-workflow ] @@ -375,7 +395,12 @@ jobs: GH_ACTION_STEP: ${{ github.job }} TARGET_TYPE: "sdk" publish-nuget: - if: ${{ always() && needs.run-workflow.outputs.csharp_regenerated == 'true' && needs.run-workflow.outputs.publish_csharp == 'true' && inputs.mode != 'pr' }} + if: ${{ always() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + needs.run-workflow.outputs.csharp_regenerated == 'true' && + needs.run-workflow.outputs.publish_csharp == 'true' + && inputs.mode != 'pr' }} name: Publish C# SDK runs-on: ubuntu-latest needs: [ run-workflow ] @@ -420,7 +445,12 @@ jobs: GH_ACTION_STEP: ${{ github.job }} TARGET_TYPE: "sdk" publish-packagist: - if: ${{ always() && needs.run-workflow.outputs.php_regenerated == 'true' && needs.run-workflow.outputs.publish_php == 'true' && inputs.mode != 'pr' }} + if: ${{ always() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + needs.run-workflow.outputs.php_regenerated == 'true' && + needs.run-workflow.outputs.publish_php == 'true' + && inputs.mode != 'pr' }} name: Publish PHP SDK runs-on: ubuntu-latest needs: [ run-workflow ] diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 4c822538..11b28c84 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -67,7 +67,7 @@ func Run(installationURLs map[string]string, repoURL string, repoSubdirectories fmt.Println("force input enabled - setting SPEAKEASY_FORCE_GENERATION=true") os.Setenv("SPEAKEASY_FORCE_GENERATION", "true") } - + if environment.ShouldOutputTests() { // TODO: Add CLI flag for outputting tests }