Skip to content

Bump version to 0.1.2 #5

Bump version to 0.1.2

Bump version to 0.1.2 #5

Workflow file for this run

name: Create GitHub Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g. v0.3.0). Required for manual runs.'
required: true
permissions:
contents: write
actions: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
wait-for-publishes:
name: Wait for SDK publishes
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Wait for all SDK release workflows
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
WORKFLOWS=("release-go.yml" "release-typescript.yml" "release-ruby.yml" "release-swift.yml" "release-kotlin.yml")
TAG="${GITHUB_REF#refs/tags/}"
MAX_WAIT=1800 # 30 minutes
POLL=30
ELAPSED=0
while [ $ELAPSED -lt $MAX_WAIT ]; do
ALL_DONE=true
ANY_FAILED=false
STATUS_LINE=""
for WF in "${WORKFLOWS[@]}"; do
# Fetch recent runs and find the one matching this tag push
RUN_JSON=$(gh run list \
--repo "$GITHUB_REPOSITORY" \
--workflow "$WF" \
--branch "$TAG" \
--limit 5 \
--json conclusion,headSha \
--jq "[.[] | select(.headSha == \"$GITHUB_SHA\")] | .[0] // empty")
if [ -z "$RUN_JSON" ]; then
ALL_DONE=false
STATUS_LINE+=" ⏳ $WF: waiting for current run"$'\n'
continue
fi
CONCLUSION=$(echo "$RUN_JSON" | jq -r '.conclusion // empty')
if [ -z "$CONCLUSION" ]; then
ALL_DONE=false
STATUS_LINE+=" ⏳ $WF: in progress"$'\n'
elif [ "$CONCLUSION" = "success" ]; then
STATUS_LINE+=" ✅ $WF: success"$'\n'
else
ANY_FAILED=true
STATUS_LINE+=" ❌ $WF: $CONCLUSION"$'\n'
fi
done
echo "$STATUS_LINE"
if $ANY_FAILED; then
echo "::error::One or more SDK release workflows failed"
exit 1
fi
if $ALL_DONE; then
echo "All SDK release workflows completed successfully"
exit 0
fi
echo "Waiting ${POLL}s for remaining workflows... (${ELAPSED}s elapsed)"
sleep $POLL
ELAPSED=$((ELAPSED + POLL))
done
echo "::error::Timed out waiting for SDK release workflows after ${MAX_WAIT}s"
echo "Final status:"
echo "$STATUS_LINE"
exit 1
release:
name: Create Release
needs: [wait-for-publishes]
if: always() && (needs.wait-for-publishes.result == 'success' || needs.wait-for-publishes.result == 'skipped')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Resolve tag
id: tag
env:
EVENT_NAME: ${{ github.event_name }}
INPUT_TAG: ${{ github.event.inputs.tag }}
run: |
if [ "$EVENT_NAME" = "push" ]; then
TAG="${GITHUB_REF#refs/tags/}"
else
TAG="$INPUT_TAG"
if [ -z "$TAG" ]; then
echo "::error::tag input is required for manual runs"
exit 1
fi
if [[ "$TAG" != v* ]]; then
echo "::error::tag must start with 'v' (e.g. v0.3.0), got: $TAG"
exit 1
fi
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "Resolved tag: $TAG"
- name: Verify tag is on main
env:
TAG: ${{ steps.tag.outputs.tag }}
run: |
git fetch origin main
TAG_SHA=$(git rev-parse "refs/tags/${TAG}^{commit}" 2>/dev/null || git rev-parse "refs/tags/${TAG}^{}" 2>/dev/null)
git merge-base --is-ancestor "$TAG_SHA" origin/main
- name: Extract version
id: version
env:
VERSION: ${{ steps.tag.outputs.tag }}
run: |
SEMVER="${VERSION#v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "semver=$SEMVER" >> "$GITHUB_OUTPUT"
- name: Checkout tag
if: github.event_name == 'workflow_dispatch'
env:
TAG: ${{ steps.tag.outputs.tag }}
run: git checkout "refs/tags/$TAG"
- name: Build installation body
env:
VERSION: ${{ steps.version.outputs.version }}
SEMVER: ${{ steps.version.outputs.semver }}
run: |
{
echo "## Installation"
echo ""
echo "**Go**"
echo '```'
echo "go get github.com/basecamp/fizzy-sdk/go@${VERSION}"
echo '```'
echo ""
echo "**TypeScript**"
echo '```'
echo "npm install @37signals/fizzy@${SEMVER}"
echo '```'
echo ""
echo "**Ruby**"
echo '```'
echo "gem install fizzy-sdk -v ${SEMVER}"
echo '```'
echo ""
echo "**Swift**"
echo '```swift'
echo ".package(url: \"https://github.com/basecamp/fizzy-sdk.git\", from: \"${SEMVER}\")"
echo '```'
echo ""
echo "**Kotlin**"
echo '```kotlin'
echo "implementation(\"com.basecamp:fizzy-sdk:${SEMVER}\")"
echo '```'
} > body.md
- name: Create GitHub Release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: Fizzy SDK ${{ steps.version.outputs.version }}
body_path: body.md
generate_release_notes: true
draft: ${{ github.event_name == 'workflow_dispatch' }}
prerelease: ${{ contains(steps.version.outputs.version, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}