-
Notifications
You must be signed in to change notification settings - Fork 21
65 lines (60 loc) · 2.39 KB
/
vscode-stable-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: vscode-stable-release
on:
push:
tags:
- vscode-v*
jobs:
release:
if: github.repository == 'sourcegraph/openctx'
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write # for publishing the release
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7
with:
node-version-file: .tool-versions
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598
with:
run_install: true
- name: get release version
id: release_version
run: |
TAGGED_VERSION="${GITHUB_REF/refs\/tags\/vscode-v/}"
if [[ ! "${TAGGED_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
echo "Invalid version tag '${TAGGED_VERSION}'"
exit 1
fi
echo "EXT_VERSION=${TAGGED_VERSION}" >> $GITHUB_ENV
WRITTEN_VERSION="$(cat client/vscode/package.json | jq '.version' -r)"
if [[ "${TAGGED_VERSION}" != "${WRITTEN_VERSION}" ]]; then
echo "Release tag and version in client/vscode/package.json do not match: '${TAGGED_VERSION}' vs. '${WRITTEN_VERSION}'"
exit 1
fi
- run: pnpm build
- run: pnpm run test
- run: xvfb-run -a pnpm -C client/vscode run test:integration
- run: RELEASE_TYPE=stable pnpm -C client/vscode run release
if: github.repository == 'sourcegraph/openctx'
env:
VSCODE_MARKETPLACE_TOKEN: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
VSCODE_OPENVSX_TOKEN: ${{ secrets.VSCODE_OPENVSX_TOKEN }}
- name: create release
id: create_release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: OpenCtx for VS Code ${{ env.EXT_VERSION }}
draft: false
- name: upload release asset
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: client/vscode/dist/openctx.vsix
asset_name: openctx-vscode-${{ env.EXT_VERSION }}.vsix
asset_content_type: application/zip