Skip to content

Commit e2119e3

Browse files
committed
ci: publish prerelease to marketplace on main merges
- Add preview job to `ci.yaml` to package and publish pre-release using vsce - Trigger only on pushes to `main` when `VSCE_PAT` is set - Keeps stable releases in `release.yaml` Refs: #97
1 parent c26018f commit e2119e3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,31 @@ jobs:
4141
- run: yarn
4242

4343
- run: yarn test:ci
44+
45+
preview:
46+
name: preview prerelease (marketplace)
47+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && secrets.VSCE_PAT != ''
48+
runs-on: ubuntu-22.04
49+
needs: [lint, test]
50+
permissions:
51+
contents: read
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- uses: actions/setup-node@v4
56+
with:
57+
node-version: "22"
58+
59+
- run: yarn
60+
61+
- name: Compute prerelease version
62+
id: version
63+
run: |
64+
BASE_VERSION=$(node -p "require('./package.json').version")
65+
SHORT_SHA=${GITHUB_SHA::7}
66+
echo "value=${BASE_VERSION}-pre.${GITHUB_RUN_NUMBER}.${SHORT_SHA}" >> $GITHUB_OUTPUT
67+
68+
- name: Publish prerelease to VS Code Marketplace
69+
env:
70+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
71+
run: npx vsce publish --pre-release --no-git-tag-version ${{ steps.version.outputs.value }}

0 commit comments

Comments
 (0)