Skip to content

Commit 95172f2

Browse files
msarsonCopilot
andcommitted
ci: Replace create-release with full automated release workflow
- Merges version branch to master - Runs tests (aborts on failure) - Builds VSIX and creates GitHub release - Publishes to VS Code Marketplace via VSCE_PAT - Creates next version branch and sets it as default on GitHub Also adds CONTRIBUTING.md explaining the branching model Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 745f9a2 commit 95172f2

3 files changed

Lines changed: 155 additions & 90 deletions

File tree

.github/workflows/create-release.yml

Lines changed: 0 additions & 90 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version being released (e.g., 0.8.8)'
8+
required: true
9+
type: string
10+
next_version:
11+
description: 'Next development version branch to create (e.g., 0.8.9)'
12+
required: true
13+
type: string
14+
15+
permissions:
16+
contents: write
17+
administration: write
18+
19+
jobs:
20+
release:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout version branch
25+
uses: actions/checkout@v4
26+
with:
27+
ref: version-${{ inputs.version }}
28+
fetch-depth: 0
29+
30+
- name: Configure git
31+
run: |
32+
git config user.name "github-actions[bot]"
33+
git config user.email "github-actions[bot]@users.noreply.github.com"
34+
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: '20'
39+
cache: 'npm'
40+
41+
- name: Install dependencies
42+
run: npm ci
43+
44+
- name: Run tests
45+
run: npm run test:server
46+
47+
- name: Compile release build
48+
run: npm run compile:release
49+
50+
- name: Install vsce
51+
run: npm install -g @vscode/vsce
52+
53+
- name: Package extension
54+
run: vsce package
55+
56+
- name: Merge version branch into master
57+
run: |
58+
git checkout master
59+
git merge version-${{ inputs.version }} --no-ff -m "Release v${{ inputs.version }}: merge version-${{ inputs.version }} into master"
60+
git push origin master
61+
62+
- name: Create GitHub Release
63+
uses: softprops/action-gh-release@v2
64+
with:
65+
tag_name: v${{ inputs.version }}
66+
name: Release v${{ inputs.version }}
67+
draft: false
68+
prerelease: false
69+
files: ./clarion-extensions-${{ inputs.version }}.vsix
70+
generate_release_notes: true
71+
body: |
72+
## Installation
73+
74+
Download the VSIX file below and install it in VS Code:
75+
1. Open VS Code
76+
2. Go to Extensions (Ctrl+Shift+X)
77+
3. Click "..." menu → "Install from VSIX..."
78+
4. Select the downloaded file
79+
80+
## Marketplace
81+
82+
This version is also available on the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=msarson.clarion-extensions).
83+
84+
## What's New
85+
86+
See [CHANGELOG.md](https://github.com/msarson/Clarion-Extension/blob/master/CHANGELOG.md) for full details.
87+
88+
- name: Publish to VS Code Marketplace
89+
run: vsce publish --pat ${{ secrets.VSCE_PAT }}
90+
91+
- name: Create next version branch
92+
run: |
93+
git checkout master
94+
git checkout -b version-${{ inputs.next_version }}
95+
git push origin version-${{ inputs.next_version }}
96+
97+
- name: Set next version branch as default
98+
run: |
99+
gh api --method PATCH /repos/msarson/Clarion-Extension \
100+
-f default_branch=version-${{ inputs.next_version }}
101+
env:
102+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Contributing to Clarion Extension
2+
3+
Thanks for your interest in contributing! Please read the following before opening a PR.
4+
5+
## Branching Model
6+
7+
This project uses a simple release-branch model:
8+
9+
| Branch | Purpose |
10+
|--------|---------|
11+
| `master` | Stable released code — only updated at release time |
12+
| `version-X.X.X` | Active development for the next release |
13+
14+
**Always branch from and target the current development branch** (e.g. `version-0.8.8`), not `master`. You can see which branch is the current development branch by checking the repository's default branch.
15+
16+
PRs targeting `master` directly will be asked to retarget.
17+
18+
## Getting Started
19+
20+
```bash
21+
git clone https://github.com/msarson/Clarion-Extension.git
22+
cd Clarion-Extension
23+
git checkout version-0.8.8 # or whatever the current default branch is
24+
npm install
25+
npm run compile
26+
```
27+
28+
## Development
29+
30+
```bash
31+
npm run watch # continuous rebuild
32+
npm run test:server # run server-side tests (no VS Code needed)
33+
npm run test:client # run client tests (requires VS Code Extension Host)
34+
```
35+
36+
Press **F5** in VS Code to launch an Extension Development Host for manual testing.
37+
38+
## Submitting a PR
39+
40+
1. Fork the repo
41+
2. Branch from the current development branch (`version-X.X.X`)
42+
3. Make your changes with tests where applicable
43+
4. Ensure `npm run test:server` passes
44+
5. Open a PR targeting the current development branch
45+
46+
## Release Process
47+
48+
Releases are handled by the maintainer via the **Release** GitHub Actions workflow, which:
49+
- Merges the version branch into `master`
50+
- Builds and packages the VSIX
51+
- Creates a GitHub release
52+
- Publishes to the VS Code Marketplace
53+
- Creates the next development branch and sets it as default

0 commit comments

Comments
 (0)