-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (111 loc) · 3.47 KB
/
Copy pathrelease.yml
File metadata and controls
133 lines (111 loc) · 3.47 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Release
on:
push:
branches: [main]
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
package:
name: Verify and package
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 24.11.0
package-manager-cache: false
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.7.0 --activate
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm format:check
- run: pnpm test
- run: rm -rf dist && mkdir -p dist && pnpm package
- name: Upload packaged VSIX
uses: actions/upload-artifact@v7
with:
name: opencode-for-copilot-vsix
path: dist/*.vsix
if-no-files-found: error
retention-days: 30
release:
needs: package
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v5
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: .github/release-please-config.json
manifest-file: .github/release-please-manifest.json
publish:
needs: [package, release]
if: needs.release.outputs.release_created == 'true'
runs-on: ubuntu-latest
environment: production
concurrency:
group: publish-${{ needs.release.outputs.tag_name }}
cancel-in-progress: false
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
ref: ${{ needs.release.outputs.tag_name }}
- uses: actions/setup-node@v6
with:
node-version: 24.11.0
package-manager-cache: false
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.7.0 --activate
- run: pnpm install --frozen-lockfile
- name: Download packaged VSIX
uses: actions/download-artifact@v7
with:
name: opencode-for-copilot-vsix
path: dist
- name: Locate VSIX
id: vsix
shell: bash
run: |
shopt -s nullglob
files=(dist/*.vsix)
if [ "${#files[@]}" -ne 1 ]; then
echo "Expected exactly one VSIX in dist, found ${#files[@]}" >&2
printf '%s\n' "${files[@]}" >&2
exit 1
fi
echo "path=${files[0]}" >> "$GITHUB_OUTPUT"
- name: Publish to VS Code Marketplace
if: vars.PUBLISH_VSCODE_MARKETPLACE != 'false'
run: pnpm exec vsce publish --packagePath "${{ steps.vsix.outputs.path }}" --skip-duplicate
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Publish to Open VSX
if: vars.PUBLISH_OPEN_VSX != 'false'
run: pnpm exec ovsx publish --skip-duplicate "${{ steps.vsix.outputs.path }}"
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
- name: Attach VSIX to GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ needs.release.outputs.tag_name }}
files: ${{ steps.vsix.outputs.path }}
fail_on_unmatched_files: true
- name: Show release info
run: |
echo "Released ${{ needs.release.outputs.tag_name }}"