Skip to content

feat: enhance model assignment handling and session configuration upd… #14

feat: enhance model assignment handling and session configuration upd…

feat: enhance model assignment handling and session configuration upd… #14

name: Build Extension
on:
push:
branches:
- '**'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: extension-build-${{ github.ref }}
cancel-in-progress: true
jobs:
package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '20'
cache: npm
- name: Install dependencies
run: npm ci
- name: Compute CI version
shell: bash
run: |
set -euo pipefail
BASE_VERSION="$(node -p "require('./package.json').version.split('-')[0]")"
CI_VERSION="${BASE_VERSION}-ci.${GITHUB_RUN_NUMBER}"
node -e "const fs=require('fs'); const pkg=JSON.parse(fs.readFileSync('package.json','utf8')); pkg.version='${CI_VERSION}'; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');"
echo "CI_VERSION=${CI_VERSION}" >> "$GITHUB_ENV"
echo "VSIX_NAME=agentic-flow-${CI_VERSION}.vsix" >> "$GITHUB_ENV"
- name: Build extension
run: npm run compile
- name: Package VSIX
shell: bash
run: |
set -euo pipefail
mkdir -p dist
npx @vscode/vsce package --allow-missing-repository --out "dist/${VSIX_NAME}"
- name: Upload workflow artifact
uses: actions/upload-artifact@v6
with:
name: ${{ env.VSIX_NAME }}
path: dist/${{ env.VSIX_NAME }}
if-no-files-found: error
- name: Publish prerelease on main
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
set -euo pipefail
NOTES=$(cat <<EOF
Automated extension build from \`${GITHUB_SHA}\`.
Version: \`${CI_VERSION}\`
Branch: \`${GITHUB_REF_NAME}\`
Commit: \`${{ github.event.head_commit.message }}\`
EOF
)
if gh release view latest-build >/dev/null 2>&1; then
gh release upload latest-build "dist/${VSIX_NAME}" --clobber
gh release edit latest-build \
--title "Latest Build" \
--prerelease \
--notes "$NOTES"
else
gh release create latest-build "dist/${VSIX_NAME}" \
--title "Latest Build" \
--prerelease \
--target "${GITHUB_SHA}" \
--notes "$NOTES"
fi