-
Notifications
You must be signed in to change notification settings - Fork 12
70 lines (59 loc) · 2.49 KB
/
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
66
67
68
69
70
name: Release
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: |
yarn install --frozen-lockfile
- name: Update Segment
run: |
set -e
setSegmentKey="setpath([\"segmentKey\"]; \"untrusted-dummy-key\")"
setConfigcatKey="setpath([\"configcatKey\"]; \"gitpod\")"
jqCommands="${setSegmentKey} | ${setConfigcatKey}"
cat package.json | jq "${jqCommands}" > package.json.tmp
mv package.json.tmp package.json
- name: Generate package.json
run: |
set -e
node ./scripts/prepare-release-build.js
mv package.release.json package.json
- name: Package extension
id: package_vsix
run: |
yarn package
echo ::set-output name=vsix_path::$(ls *.vsix)
version=$(jq --raw-output '.version' package.json)
echo ::set-output name=version::$version
- name: Ensure new version
run: |
latest_tag=$(curl --silent -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/gitpod-io/gitpod-vscode-desktop/releases/latest | jq --raw-output '.tag_name')
if [ "$latest_tag" = "v${{ steps.package_vsix.outputs.version }}" ]; then
exit 1
fi
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.package_vsix.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
files: ${{ steps.package_vsix.outputs.vsix_path }}
- name: Publish to MS Marketplace
run: |
npx vsce publish --packagePath ${{ steps.package_vsix.outputs.vsix_path }}
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Update Action Summary
run: |
echo "Successfully released the \`gitpod-vscode-desktop\` extension (\`gitpod.gitpod-desktop\`) with the version: \`v${{ steps.package_vsix.outputs.version }}\`" >> summary.md
echo "" >> summary.md
echo "SHA: ${{ github.sha }}" >> summary.md
echo "Hub URL: https://marketplace.visualstudio.com/manage/publishers/gitpod/extensions/gitpod-desktop/hub" >> summary.md
echo "Extension URL: https://marketplace.visualstudio.com/items?itemName=gitpod.gitpod-desktop" >> summary.md
cat summary.md >> $GITHUB_STEP_SUMMARY