Skip to content

Commit af48aec

Browse files
authored
Pipeline/beta release (#92)
* feat: add GitHub Actions workflow for beta release process * chore: update VSCode engine version to ^1.63.0 in package.json
1 parent da1e479 commit af48aec

2 files changed

Lines changed: 204 additions & 1 deletion

File tree

.github/workflows/beta-release.yml

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
name: Beta Release
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
paths-ignore:
7+
- '.github/workflows/**'
8+
- '**.md'
9+
- 'docs/**'
10+
workflow_dispatch:
11+
inputs:
12+
force_publish:
13+
description: 'Force beta publish (ignore checks)'
14+
required: false
15+
default: false
16+
type: boolean
17+
18+
jobs:
19+
# Build and create beta release
20+
build-beta:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
version: ${{ steps.package.outputs.version }}
24+
beta_version: ${{ steps.package.outputs.beta_version }}
25+
vsix_name: ${{ steps.build.outputs.vsix_name }}
26+
should_publish: ${{ steps.verify.outputs.should_publish }}
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: '20'
38+
39+
- name: Install dependencies
40+
run: npm ci
41+
42+
- name: Compile TypeScript
43+
run: npm run compile
44+
45+
- name: Lint code
46+
run: npm run lint
47+
48+
- name: Verify changes
49+
id: verify
50+
run: |
51+
# For manual triggers with force flag
52+
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.force_publish }}" = "true" ]; then
53+
echo "🚀 Manual workflow dispatch with force publish - proceeding with beta release"
54+
echo "should_publish=true" >> $GITHUB_OUTPUT
55+
exit 0
56+
fi
57+
58+
# Get changed files
59+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
60+
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD | tr '\n' ' ')
61+
elif [ -z "${{ github.event.before }}" ] || [ "${{ github.event.before }}" = "0000000000000000000000000000000000000000" ]; then
62+
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || git ls-files | tr '\n' ' ')
63+
else
64+
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | tr '\n' ' ')
65+
fi
66+
67+
echo "📋 Changed files: $CHANGED_FILES"
68+
69+
# Check if only documentation or workflow files were changed
70+
SKIP_PUBLISH=true
71+
for file in $CHANGED_FILES; do
72+
if [[ ! $file =~ \.(md|txt)$ ]] && [[ ! $file =~ ^docs/ ]] && [[ ! $file =~ ^\.github/workflows/ ]]; then
73+
SKIP_PUBLISH=false
74+
break
75+
fi
76+
done
77+
78+
if [[ "$SKIP_PUBLISH" == "true" ]]; then
79+
echo "📚 Only documentation or workflow files changed - skipping beta release"
80+
echo "should_publish=false" >> $GITHUB_OUTPUT
81+
else
82+
echo "✅ Code changes detected - proceeding with beta release"
83+
echo "should_publish=true" >> $GITHUB_OUTPUT
84+
fi
85+
86+
- name: Get package info and create beta version
87+
id: package
88+
run: |
89+
VERSION=$(node -p "require('./package.json').version")
90+
TIMESTAMP=$(date +'%Y%m%d%H%M%S')
91+
BETA_VERSION="${VERSION}-beta.${TIMESTAMP}"
92+
93+
echo "version=$VERSION" >> $GITHUB_OUTPUT
94+
echo "beta_version=$BETA_VERSION" >> $GITHUB_OUTPUT
95+
echo "timestamp=$TIMESTAMP" >> $GITHUB_OUTPUT
96+
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
97+
98+
echo "📦 Base version: $VERSION"
99+
echo "🔬 Beta version: $BETA_VERSION"
100+
101+
- name: Update package.json with beta version
102+
if: steps.verify.outputs.should_publish == 'true'
103+
run: |
104+
node -e "
105+
const fs = require('fs');
106+
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
107+
pkg.version = '${{ steps.package.outputs.beta_version }}';
108+
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
109+
"
110+
echo "✅ Updated package.json to beta version"
111+
112+
- name: Build VSIX package
113+
id: build
114+
if: steps.verify.outputs.should_publish == 'true'
115+
run: |
116+
npm install -g @vscode/vsce@latest
117+
rm -f *.vsix
118+
vsce package --pre-release
119+
120+
VSIX_NAME="simple-coding-time-tracker-${{ steps.package.outputs.beta_version }}.vsix"
121+
echo "vsix_name=$VSIX_NAME" >> $GITHUB_OUTPUT
122+
123+
# Validate VSIX
124+
if [ ! -f "$VSIX_NAME" ]; then
125+
echo "❌ VSIX build failed"
126+
exit 1
127+
fi
128+
129+
# Get file size
130+
SIZE=$(stat -c%s "$VSIX_NAME" 2>/dev/null || stat -f%z "$VSIX_NAME")
131+
SIZE_MB=$((SIZE / 1024 / 1024))
132+
133+
echo "📦 Package size: ${SIZE_MB}MB"
134+
echo "✅ Beta VSIX built successfully - $VSIX_NAME"
135+
136+
- name: Upload VSIX artifact
137+
if: steps.verify.outputs.should_publish == 'true'
138+
uses: actions/upload-artifact@v4
139+
with:
140+
name: extension-vsix-beta-${{ steps.package.outputs.beta_version }}
141+
path: ${{ steps.build.outputs.vsix_name }}
142+
retention-days: 30
143+
144+
# Create GitHub Release for beta
145+
create-beta-release:
146+
needs: build-beta
147+
if: needs.build-beta.outputs.should_publish == 'true'
148+
runs-on: ubuntu-latest
149+
permissions:
150+
contents: write
151+
152+
steps:
153+
- name: Checkout code
154+
uses: actions/checkout@v4
155+
156+
- name: Download VSIX artifact
157+
uses: actions/download-artifact@v4
158+
with:
159+
name: extension-vsix-beta-${{ needs.build-beta.outputs.beta_version }}
160+
161+
- name: Create GitHub Beta Release
162+
uses: softprops/action-gh-release@v1
163+
with:
164+
tag_name: v${{ needs.build-beta.outputs.beta_version }}
165+
name: Beta Release v${{ needs.build-beta.outputs.beta_version }}
166+
body: |
167+
🔬 **Beta Release**
168+
169+
This is a pre-release build from the `develop` branch for testing purposes.
170+
171+
**Base Version:** ${{ needs.build-beta.outputs.version }}
172+
**Beta Version:** ${{ needs.build-beta.outputs.beta_version }}
173+
**Branch:** develop
174+
**Commit:** ${{ github.sha }}
175+
176+
### Installation
177+
Download the `.vsix` file and install manually:
178+
1. Download `${{ needs.build-beta.outputs.vsix_name }}`
179+
2. Open VS Code
180+
3. Go to Extensions view (Ctrl+Shift+X)
181+
4. Click on "..." menu → Install from VSIX...
182+
5. Select the downloaded file
183+
184+
### ⚠️ Warning
185+
This is a beta release and may contain bugs or incomplete features. Use at your own risk.
186+
187+
### Feedback
188+
Please report any issues or feedback on the [GitHub Issues](https://github.com/${{ github.repository }}/issues) page.
189+
files: ${{ needs.build-beta.outputs.vsix_name }}
190+
draft: false
191+
prerelease: true
192+
env:
193+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
194+
195+
- name: Summary
196+
run: |
197+
echo "### 🎉 Beta Release Created Successfully!" >> $GITHUB_STEP_SUMMARY
198+
echo "" >> $GITHUB_STEP_SUMMARY
199+
echo "**Version:** ${{ needs.build-beta.outputs.beta_version }}" >> $GITHUB_STEP_SUMMARY
200+
echo "**Tag:** v${{ needs.build-beta.outputs.beta_version }}" >> $GITHUB_STEP_SUMMARY
201+
echo "**VSIX:** ${{ needs.build-beta.outputs.vsix_name }}" >> $GITHUB_STEP_SUMMARY
202+
echo "" >> $GITHUB_STEP_SUMMARY
203+
echo "🔗 [View Release](https://github.com/${{ github.repository }}/releases/tag/v${{ needs.build-beta.outputs.beta_version }})" >> $GITHUB_STEP_SUMMARY

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"license": "MIT",
88
"icon": "icon-sctt.png",
99
"engines": {
10-
"vscode": "^1.60.0"
10+
"vscode": "^1.63.0"
1111
},
1212
"categories": [
1313
"Other"

0 commit comments

Comments
 (0)