Skip to content

SMOODEV-713: bump astral-sh/setup-uv@v3 to @v6 + replace unmaintained… #158

SMOODEV-713: bump astral-sh/setup-uv@v3 to @v6 + replace unmaintained…

SMOODEV-713: bump astral-sh/setup-uv@v3 to @v6 + replace unmaintained… #158

Workflow file for this run

name: Release (Changesets 🦋)
on:
workflow_dispatch:
push:
branches:
- main
concurrency:
group: release
cancel-in-progress: false
env:
CI: true
jobs:
version:
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
actions: write
steps:
- name: Checkout code repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust build artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: |
rust/logger -> rust/logger/target
log-viewer -> log-viewer/target
cache-on-failure: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Set up uv
uses: astral-sh/setup-uv@v6
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
cache-dependency-path: go/go.sum
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Install dependencies
run: pnpm install
- name: Typecheck
run: pnpm typecheck
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test
- name: Build
run: pnpm build
- name: Format
run: pnpm format
- name: Version Update 🦋
id: changesets
uses: changesets/action@v1
with:
commit: "🦋 New version release"
title: "🦋 New version release"
publish: pnpm ci:publish
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.SMOOAI_NPM_TOKEN }}
- name: Publish smooai-logger to PyPI
if: steps.changesets.outputs.published == 'true'
working-directory: python
env:
UV_PUBLISH_TOKEN: ${{ secrets.SMOOAI_PYPI_TOKEN }}
run: |
# Clean stale build artifacts to prevent re-uploading old versions
rm -rf dist/
uv run poe publish
- name: Publish smooai-logger to crates.io
if: steps.changesets.outputs.published == 'true'
# --allow-dirty is needed because version:sync modifies Cargo.toml/Cargo.lock
# without committing them during the CI publish flow
run: cargo publish --allow-dirty --manifest-path rust/logger/Cargo.toml
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.SMOOAI_CARGO_REGISTRY_TOKEN }}
- name: Tag and publish Go module
if: steps.changesets.outputs.published == 'true'
run: |
VERSION=$(node -p "require('./package.json').version")
TAG="go/v${VERSION}"
echo "Creating Go module tag: ${TAG}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "${TAG}"
git push origin "${TAG}"
echo "Go module tagged and pushed: ${TAG}"
- name: Build and test .NET
if: steps.changesets.outputs.published == 'true'
working-directory: dotnet
run: |
dotnet restore SmooAI.Logger.sln
dotnet build SmooAI.Logger.sln -c Release --no-restore
dotnet test SmooAI.Logger.sln -c Release --no-build --nologo
- name: Pack and publish SmooAI.Logger to NuGet
if: steps.changesets.outputs.published == 'true'
run: |
VERSION=$(node -p "require('./package.json').version")
echo "Packing SmooAI.Logger ${VERSION}"
dotnet pack dotnet/src/SmooAI.Logger/SmooAI.Logger.csproj \
--configuration Release \
-p:Version=${VERSION} \
-p:PackageVersion=${VERSION} \
-o dotnet/artifacts
for pkg in dotnet/artifacts/*.nupkg; do
echo "Pushing $pkg to NuGet..."
dotnet nuget push "$pkg" \
--api-key "${NUGET_API_KEY}" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
done
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
- name: Auto-Merge Changeset PR
run: |
PR_NUMBER=$(gh pr list --state open --head changeset-release/main --json number --jq '.[0].number')
if [[ -n "$PR_NUMBER" && "$PR_NUMBER" != "null" ]]; then
echo "Found Changeset PR #$PR_NUMBER, attempting to auto-merge..."
gh pr merge "$PR_NUMBER" --auto --squash
# The merge push automatically triggers the Release workflow
# so no need to manually re-trigger it
else
echo "No open Changeset PR found, skipping merge."
fi
env:
GH_TOKEN: ${{ secrets.GH_PAT }}