Skip to content

chore(sdk): release 4.12.0 #23

chore(sdk): release 4.12.0

chore(sdk): release 4.12.0 #23

Workflow file for this run

name: Release SDK
on:
push:
tags:
- 'sdk-v*'
workflow_dispatch:
inputs:
tag:
description: 'Existing sdk-v* tag to (re-)release'
required: true
concurrency:
group: release-sdk-${{ github.event.inputs.tag || github.ref_name }}
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.inputs.tag || github.ref_name }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
version: 10.26.0
- name: Install workspace dependencies
run: pnpm install --frozen-lockfile
- name: Build asyar-sdk (types + CLI)
working-directory: asyar-sdk
run: pnpm run build:all
- name: Publish to npm (skip if version already published)
working-directory: asyar-sdk
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
VERSION=$(node -p "require('./package.json').version")
if npm view "asyar-sdk@$VERSION" version >/dev/null 2>&1; then
echo "asyar-sdk@$VERSION already on npm — skipping publish (idempotent re-run)."
else
npm publish
fi
- name: Determine previous SDK release tag
id: prev_tag
run: |
CURRENT_TAG="${{ github.event.inputs.tag || github.ref_name }}"
PREV_TAG=$(git tag -l 'sdk-v*' --sort=-creatordate | grep -Fvx "$CURRENT_TAG" | head -n 1)
echo "tag=$PREV_TAG" >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2.6.1
with:
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
draft: false
prerelease: ${{ contains(github.event.inputs.tag || github.ref_name, '-') }}
generate_release_notes: true
# GitHub's auto-notes otherwise diffs against the most recently
# published release repo-wide, which is usually a launcher `v*`
# tag (cut far more often than `sdk-v*`) — pin the base explicitly
# so notes only cover commits since the last SDK release.
previous_tag: ${{ steps.prev_tag.outputs.tag }}