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
x-realizes-capability-ids:
- BC-4200.40
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-4200.40
capability_name: Software Construction Management
spec: github-repos-api-openapi.yml
confidence: 0.75
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: reposApi
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: repos/create-release
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: repos/upload-release-asset
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
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.