Skip to content

chore(sbot): sync release notes for v0.2.8 #16

chore(sbot): sync release notes for v0.2.8

chore(sbot): sync release notes for v0.2.8 #16

Workflow file for this run

name: Release sbot
on:
push:
tags: ['sbot-v*']
workflow_dispatch:
permissions:
contents: write
concurrency:
group: release-sbot-${{ github.ref }}
cancel-in-progress: false
jobs:
release-sbot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: while-coder/workflows/.github/actions/setup-pnpm@main
- run: pnpm install --frozen-lockfile
- name: Build sbot
run: pnpm run build:sbot
- name: Resolve and verify version
id: version
shell: bash
run: |
PKG_VERSION=$(node -p "require('./packages/sbot/package.json').version")
if [ "${{ github.event_name }}" = "push" ]; then
TAG_VERSION="${GITHUB_REF_NAME#sbot-v}"
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "::error::Tag version ($TAG_VERSION) does not match packages/sbot/package.json version ($PKG_VERSION)"
exit 1
fi
fi
echo "version=$PKG_VERSION" >> "$GITHUB_OUTPUT"
echo "tag=sbot-v$PKG_VERSION" >> "$GITHUB_OUTPUT"
- name: Extract release notes
id: notes
shell: bash
run: |
BODY=$(node -e "
const p = require('./packages/sbot/package.json');
const en = p.releasenoteEn || '';
const zh = p.releasenoteZh || '';
process.stdout.write([en, zh].filter(Boolean).join('\n\n'));
")
[ -z "$BODY" ] && BODY="sbot v${{ steps.version.outputs.version }}"
{
echo "body<<RELEASE_NOTES_EOF"
echo "$BODY"
echo "RELEASE_NOTES_EOF"
} >> "$GITHUB_OUTPUT"
# - name: Publish to npm
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: pnpm --filter @qingfeng346/sbot publish --no-git-checks --access public
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build Docker image
# run: node packages/sbot/scripts/docker.js build
# - name: Push Docker image
# run: node packages/sbot/scripts/docker.js publish
- name: Recreate GitHub Release
if: github.event_name == 'push'
uses: while-coder/workflows/.github/actions/recreate-github-release@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
title: sbot v${{ steps.version.outputs.version }}
notes: ${{ steps.notes.outputs.body }}