Skip to content

feat: redesigned marketplace webview #329

feat: redesigned marketplace webview

feat: redesigned marketplace webview #329

name: Collection Scripts Library CI
on:
push:
branches: [main]
paths:
- "lib/**"
- ".github/workflows/lib-collection-scripts-ci.yml"
- "package.json"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "eslint.shared.mjs"
pull_request:
branches: [main]
paths:
- "lib/**"
- ".github/workflows/lib-collection-scripts-ci.yml"
- "package.json"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "eslint.shared.mjs"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
env:
NODE_VERSION: "24"
jobs:
lint-and-test:
name: Lint and Test
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: "fs"
scan-ref: lib
format: "sarif"
output: "trivy-lib-results.sarif"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: "trivy-lib-results.sarif"
category: lib
- name: Setup pnpm
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
cache-dependency-path: "pnpm-lock.yaml"
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build TypeScript
run: pnpm -C lib run build
- name: Run linting
run: pnpm -C lib run lint
- name: Run tests
run: pnpm -C lib run test
publish:
name: Publish to npmjs
runs-on: ubuntu-latest
environment: npmjs
needs: lint-and-test
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
permissions:
id-token: write # Required for OIDC
contents: write
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
cache-dependency-path: "pnpm-lock.yaml"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build TypeScript
run: pnpm -C lib run build
- name: Check if version changed
working-directory: lib
id: version-check
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
# Check if this version tag already exists
if git tag -l "collection-scripts-v$PACKAGE_VERSION" | grep -q .; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "Version $PACKAGE_VERSION already published"
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Create version tag
if: steps.version-check.outputs.exists == 'false'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "collection-scripts-v${{ steps.version-check.outputs.version }}"
git push origin "collection-scripts-v${{ steps.version-check.outputs.version }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package
working-directory: lib
if: steps.version-check.outputs.exists == 'false'
run: npm publish --provenance --access public