Skip to content

ci: publish prerelease to marketplace on main merges #1190

ci: publish prerelease to marketplace on main merges

ci: publish prerelease to marketplace on main merges #1190

Workflow file for this run

name: ci

Check failure on line 1 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yaml

Invalid workflow file

(Line: 47, Col: 9): Unrecognized named-value: 'secrets'. Located at position 67 within expression: github.event_name == 'push' && github.ref == 'refs/heads/main' && secrets.VSCE_PAT != ''
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- run: yarn
- run: yarn prettier --check .
- run: yarn lint
- run: yarn build
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- run: yarn
- run: yarn test:ci
preview:
name: preview prerelease (marketplace)
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && secrets.VSCE_PAT != ''
runs-on: ubuntu-22.04
needs: [lint, test]
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- run: yarn
- name: Compute prerelease version
id: version
run: |
BASE_VERSION=$(node -p "require('./package.json').version")
SHORT_SHA=${GITHUB_SHA::7}
echo "value=${BASE_VERSION}-pre.${GITHUB_RUN_NUMBER}.${SHORT_SHA}" >> $GITHUB_OUTPUT
- name: Publish prerelease to VS Code Marketplace
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: npx vsce publish --pre-release --no-git-tag-version ${{ steps.version.outputs.value }}