-
-
Notifications
You must be signed in to change notification settings - Fork 8
64 lines (54 loc) · 2.03 KB
/
cd.yml
File metadata and controls
64 lines (54 loc) · 2.03 KB
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
name: CD
on:
push:
branches:
- main
tags:
- "v*.*.*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_type }}
cancel-in-progress: false
permissions:
contents: write
packages: write
# See https://docs.npmjs.com/generating-provenance-statements#about-npm-provenance
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
- name: Verify package version matches tag
if: github.ref_type == 'tag'
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
PACKAGE_VERSION="$(jq -r '.version' vscode/package.json)"
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "ERROR: Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)" 1>&2
exit 1
fi
- run: xvfb-run --auto-servernum make
- run: gh config set prompt disabled
env:
GH_TOKEN: ${{ github.token }}
- name: Perform Continuous Release
run: |
gh release delete continuous --cleanup-tag --yes || true
gh release create continuous --prerelease --draft=false --title continuous --target "$GITHUB_SHA" --generate-notes
gh release upload --clobber continuous build/dist/sourcemeta-studio-vscode.vsix
if: github.ref_type == 'branch'
env:
GH_TOKEN: ${{ github.token }}
- name: Perform Tag Release
run: |
gh release create ${{ github.ref_name }} --draft=false --title ${{ github.ref_name }} --target "$GITHUB_SHA" --generate-notes
gh release upload --clobber ${{ github.ref_name }} build/dist/sourcemeta-studio-vscode.vsix
if: github.ref_type == 'tag'
env:
GH_TOKEN: ${{ github.token }}
- name: Publish to VS Code Marketplace
run: npx vsce publish --packagePath build/dist/sourcemeta-studio-vscode.vsix
if: github.ref_type == 'tag'
env:
VSCE_PAT: ${{ secrets.VISUAL_STUDIO_MARKETPLACE_TOKEN }}