Skip to content

Commit 15ea816

Browse files
authored
ci: add release-please workflow with .vsix packaging (#67)
* ci: add release-please workflow with .vsix packaging Adds automated release management via release-please: - release-please-config.json: node release type, bump-minor-pre-major - .release-please-manifest.json: tracks current version (0.0.1) - release.yml: on push to main, release-please creates a release PR with changelog and version bump. When merged, the release job packages the .vsix and uploads it to the GitHub Release. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca> * docs: add release workflow to AGENTS.md project structure Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca> --------- Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent b29bbce commit 15ea816

4 files changed

Lines changed: 75 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch: {}
7+
8+
concurrency:
9+
group: release-${{ github.ref }}
10+
cancel-in-progress: false
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
release-please:
17+
name: Release Please
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 10
20+
permissions:
21+
contents: write
22+
pull-requests: write
23+
outputs:
24+
release_created: ${{ steps.release.outputs.release_created }}
25+
tag_name: ${{ steps.release.outputs.tag_name }}
26+
steps:
27+
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
28+
with:
29+
egress-policy: audit
30+
- uses: googleapis/release-please-action@a02a34c4d625f9be7cb89f4291f2343e4d2504e0 # v4.2.0
31+
id: release
32+
with:
33+
config-file: release-please-config.json
34+
manifest-file: .release-please-manifest.json
35+
36+
release:
37+
name: Package and Upload
38+
needs: [release-please]
39+
if: needs.release-please.outputs.release_created == 'true'
40+
runs-on: ubuntu-latest
41+
timeout-minutes: 15
42+
permissions:
43+
contents: write
44+
steps:
45+
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
46+
with:
47+
egress-policy: audit
48+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
49+
with:
50+
persist-credentials: false
51+
ref: ${{ needs.release-please.outputs.tag_name }}
52+
- uses: ./.github/actions/setup-node
53+
- run: npm run check
54+
- run: npx @vscode/vsce package --out patchloom.vsix
55+
- name: Upload .vsix to GitHub Release
56+
env:
57+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
run: gh release upload "${{ needs.release-please.outputs.tag_name }}" patchloom.vsix

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.1"
3+
}

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ scripts/
7777
dependabot-auto-merge.yml Auto-merge minor/patch Dependabot PRs
7878
post-merge.yml Trigger CI/security/scorecard on main after auto-merge
7979
scorecard.yml OpenSSF Scorecard analysis (weekly + on push)
80+
release.yml Release: release-please + .vsix packaging and upload
8081
security.yml Security: npm audit, Trivy fs scan, Gitleaks (weekly + on push/PR)
82+
release-please-config.json Release-please configuration (node release type)
83+
.release-please-manifest.json Current version tracking for release-please
8184
```
8285

8386
## Architecture conventions

release-please-config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"packages": {
4+
".": {
5+
"release-type": "node",
6+
"changelog-path": "CHANGELOG.md",
7+
"bump-minor-pre-major": true,
8+
"bump-patch-for-minor-pre-major": true
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)