Skip to content

Release Train

Release Train #1

Workflow file for this run

# Hand-written companion to the generated async-pipeline.yml. Keep it out of
# that file: async-pipeline.yml is owned by `async-pipeline github generate`.
#
# What this does: after a release-event run of "Async Pipeline" finishes green
# here (npm publish of @async/flow done), tell async/framework to bump its
# @async/flow pin on main. Framework does NOT release; its dep-bump.yml decides
# how the bump lands (push when green, PR when red).
#
# Requires org secret ASYNC_RELEASE_TRAIN_TOKEN (see async/pipeline's
# release-train.yml header for the PAT shape).
name: Release Train
on:
workflow_run:
workflows: ["Async Pipeline"]
types: [completed]
workflow_dispatch:
inputs:
version:
description: "Version to announce, no leading v. Empty = latest GitHub release."
required: false
default: ""
permissions: {}
concurrency:
group: release-train
cancel-in-progress: false
jobs:
fan-out:
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.event == 'release' &&
github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.ASYNC_RELEASE_TRAIN_TOKEN }}
steps:
- name: Resolve released version
id: version
env:
INPUT_VERSION: ${{ inputs.version }}
run: |
set -euo pipefail
VERSION="${INPUT_VERSION:-}"
if [ -z "$VERSION" ]; then
VERSION="$(gh api "repos/${GITHUB_REPOSITORY}/releases/latest" --jq '.tag_name')"
fi
VERSION="${VERSION#v}"
echo "Announcing @async/flow@${VERSION}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Dispatch dep bump to async/framework
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
set -euo pipefail
gh api "repos/async/framework/dispatches" \
-f event_type=async-dep-bump \
-f 'client_payload[package]=@async/flow' \
-f "client_payload[version]=${VERSION}"
echo "Dispatched async-dep-bump to async/framework for @async/flow@${VERSION}"