arazzo: 1.0.1 info: title: GitHub Publish a Release and Upload an Asset summary: Create a tagged release, then upload a binary asset to it. description: >- The release distribution pattern. The workflow creates a release for a given tag and then uploads a binary asset to that release using the upload URL and release identifier returned by the create step. The asset payload is sent as an octet stream, matching the GitHub upload endpoint. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: githubReposApi url: ../openapi/github-repos-api-openapi.yml type: openapi workflows: - workflowId: publish-release-with-asset summary: Create a release then upload a binary asset to it. description: >- Creates a release for the supplied tag and chains the returned release id into a call that uploads a binary asset. inputs: type: object required: - githubToken - owner - repo - tagName - assetName - assetContent properties: githubToken: type: string description: A GitHub token with repo scope, passed as a Bearer credential. owner: type: string description: The account owner of the repository. repo: type: string description: The name of the repository. tagName: type: string description: The name of the tag for the release. releaseName: type: string description: The display name of the release. releaseBody: type: string description: The description text of the release. assetName: type: string description: The file name of the asset to upload. assetContent: type: string description: The raw binary content of the asset to upload. steps: - stepId: createRelease description: Create the release for the supplied tag. operationId: createRelease parameters: - name: Authorization in: header value: Bearer $inputs.githubToken - name: owner in: path value: $inputs.owner - name: repo in: path value: $inputs.repo requestBody: contentType: application/json payload: tag_name: $inputs.tagName name: $inputs.releaseName body: $inputs.releaseBody successCriteria: - condition: $statusCode == 201 outputs: releaseId: $response.body#/id releaseUrl: $response.body#/html_url - stepId: uploadAsset description: >- Upload the binary asset to the newly created release using the release id returned by the create step. operationId: uploadReleaseAsset parameters: - name: Authorization in: header value: Bearer $inputs.githubToken - name: owner in: path value: $inputs.owner - name: repo in: path value: $inputs.repo - name: release_id in: path value: $steps.createRelease.outputs.releaseId - name: name in: query value: $inputs.assetName requestBody: contentType: application/octet-stream payload: $inputs.assetContent successCriteria: - condition: $statusCode == 201 outputs: assetId: $response.body#/id downloadUrl: $response.body#/browser_download_url outputs: releaseId: $steps.createRelease.outputs.releaseId releaseUrl: $steps.createRelease.outputs.releaseUrl assetId: $steps.uploadAsset.outputs.assetId downloadUrl: $steps.uploadAsset.outputs.downloadUrl