Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 6 additions & 70 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,22 @@ name: CI
on:
push:
branches: [ "*" ]
tags: [ "v*" ]
tags-ignore: [ "**" ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup Node.js ${{ matrix.node-version }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
node-version: '24.x'
cache: 'npm'

- name: Install dependencies
Expand All @@ -41,7 +37,6 @@ jobs:

- name: Run full test suite
run: xvfb-run -a npm test
continue-on-error: false

build:
needs: test
Expand All @@ -66,26 +61,9 @@ jobs:
- name: Compile extension
run: npm run vscode:prepublish

- name: Determine version suffix
- name: Get build SHA
id: version
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "suffix=" >> $GITHUB_OUTPUT
echo "release_type=release" >> $GITHUB_OUTPUT
elif [ "${{ github.ref }}" = "refs/heads/debug" ]; then
echo "suffix=-debug" >> $GITHUB_OUTPUT
echo "release_type=debug" >> $GITHUB_OUTPUT
fi
echo "sha_short=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_OUTPUT

- name: Update package.json version for non-main builds
if: github.ref != 'refs/heads/main'
run: |
# Get current version and append build info
CURRENT_VERSION=$(node -p "require('./package.json').version")
NEW_VERSION="${CURRENT_VERSION}${{ steps.version.outputs.suffix }}-${GITHUB_RUN_NUMBER}+${{ steps.version.outputs.sha_short }}"
npm version "$NEW_VERSION" --no-git-tag-version
echo "Updated version to: $NEW_VERSION"
run: echo "sha_short=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_OUTPUT

- name: Package extension
run: vsce package
Expand All @@ -95,52 +73,10 @@ jobs:
run: |
PACKAGE_FILE=$(ls *.vsix | head -1)
echo "filename=$PACKAGE_FILE" >> $GITHUB_OUTPUT
echo "name=$(basename "$PACKAGE_FILE" .vsix)" >> $GITHUB_OUTPUT

- name: Upload VSIX artifact
uses: actions/upload-artifact@v4
with:
name: vscode-extension-${{ steps.version.outputs.release_type }}-${{ steps.version.outputs.sha_short }}
name: vscode-extension-${{ steps.version.outputs.sha_short }}
path: ${{ steps.package.outputs.filename }}
retention-days: 30

release:
name: Update release info
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write

steps:
- name: Get version from tag
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Download VSIX artifact
uses: actions/download-artifact@v4
with:
pattern: vscode-extension-*
merge-multiple: true

- name: Get package filename
id: package
run: |
PACKAGE_FILE=$(ls *.vsix | head -1)
echo "filename=$PACKAGE_FILE" >> $GITHUB_OUTPUT

- name: Create release
id: release
uses: secondlife-3p/action-gh-release@v1
with:
# name the release page for the branch
name: "SL-VScode Plugin ${{ steps.version.outputs.version }} Release"
prerelease: true
generate_release_notes: true
target_commitish: ${{ github.sha }}
append_body: true
files: ${{ steps.package.outputs.filename }}
48 changes: 48 additions & 0 deletions .github/workflows/generate-release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Generate Release Notes

on:
workflow_call:
inputs:
tag_name:
description: Tag name to generate release notes for
required: true
type: string
target_commitish:
description: Branch or commit SHA used as target for note generation
required: true
type: string
outputs:
release_notes:
description: Generated release notes body
value: ${{ jobs.generate.outputs.release_notes }}

permissions:
contents: read

jobs:
generate:
runs-on: ubuntu-latest
outputs:
release_notes: ${{ steps.generate.outputs.release_notes }}

steps:
- name: Generate release notes body
id: generate
uses: actions/github-script@v7
env:
TAG_NAME: ${{ inputs.tag_name }}
TARGET_COMMITISH: ${{ inputs.target_commitish }}
with:
script: |
const { owner, repo } = context.repo;
const tag_name = process.env.TAG_NAME;
const target_commitish = process.env.TARGET_COMMITISH;

const response = await github.rest.repos.generateReleaseNotes({
owner,
repo,
tag_name,
target_commitish,
});

core.setOutput('release_notes', response.data.body || '');
10 changes: 3 additions & 7 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
branches: [main, develop]

permissions:
id-token: write
contents: read

jobs:
Expand All @@ -20,18 +19,15 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 'latest'
node-version: '24.x'
cache: 'npm'
- name: Install dependencies
run: npm install
run: npm ci

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.x'

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit checks
run: pre-commit run --all-files
uses: pre-commit/action@v3.0.1
Loading
Loading