Skip to content

Commit 3bc8d3b

Browse files
Initial commit for ClipPath project, including core files: .gitignore, package.json, biome.json, and build scripts. Added README with project overview and usage instructions. Included assets for logo and icon, and set up GitHub Actions for CI/CD. Implemented TypeScript configuration and various utility scripts for building and testing.
0 parents  commit 3bc8d3b

76 files changed

Lines changed: 6008 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Build & Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
check-version:
12+
name: Check version bump
13+
runs-on: ubuntu-latest
14+
outputs:
15+
should_release: ${{ steps.compare.outputs.should_release }}
16+
version: ${{ steps.compare.outputs.version }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 2
21+
22+
- name: Compare versions
23+
id: compare
24+
run: |
25+
CURRENT=$(node -p "require('./package.json').version")
26+
echo "Current version: $CURRENT"
27+
28+
# Get the version from the previous commit on main
29+
PREVIOUS=$(git show HEAD~1:package.json 2>/dev/null | node -p "JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')).version" 2>/dev/null || echo "0.0.0")
30+
echo "Previous version: $PREVIOUS"
31+
32+
# Compare using sort -V (version sort)
33+
HIGHER=$(printf '%s\n%s' "$PREVIOUS" "$CURRENT" | sort -V | tail -n1)
34+
35+
if [ "$CURRENT" != "$PREVIOUS" ] && [ "$CURRENT" = "$HIGHER" ]; then
36+
echo "Version bumped: $PREVIOUS → $CURRENT"
37+
echo "should_release=true" >> "$GITHUB_OUTPUT"
38+
else
39+
echo "No version bump detected, skipping build & release."
40+
echo "should_release=false" >> "$GITHUB_OUTPUT"
41+
fi
42+
43+
echo "version=$CURRENT" >> "$GITHUB_OUTPUT"
44+
45+
test:
46+
name: Test
47+
needs: check-version
48+
if: needs.check-version.outputs.should_release == 'true'
49+
runs-on: windows-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- uses: oven-sh/setup-bun@v2
54+
with:
55+
bun-version: latest
56+
57+
- run: bun install
58+
59+
- name: Typecheck
60+
run: bun run typecheck
61+
62+
- name: Tests
63+
run: bun test
64+
65+
build:
66+
name: Build
67+
needs: [check-version, test]
68+
if: needs.check-version.outputs.should_release == 'true'
69+
runs-on: windows-latest
70+
steps:
71+
- uses: actions/checkout@v4
72+
73+
- uses: oven-sh/setup-bun@v2
74+
with:
75+
bun-version: latest
76+
77+
- run: bun install
78+
79+
- name: Build executable
80+
run: bun run build
81+
82+
- name: Upload artifact
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: clippath-windows-x64
86+
path: builds/clippath.exe
87+
88+
release:
89+
name: Release
90+
needs: [check-version, build]
91+
if: needs.check-version.outputs.should_release == 'true'
92+
runs-on: ubuntu-latest
93+
steps:
94+
- uses: actions/checkout@v4
95+
96+
- name: Download artifact
97+
uses: actions/download-artifact@v4
98+
with:
99+
name: clippath-windows-x64
100+
101+
- name: Create tag
102+
run: |
103+
git tag "v${{ needs.check-version.outputs.version }}"
104+
git push origin "v${{ needs.check-version.outputs.version }}"
105+
106+
- name: Create GitHub Release
107+
uses: softprops/action-gh-release@v2
108+
with:
109+
tag_name: v${{ needs.check-version.outputs.version }}
110+
name: ClipPath v${{ needs.check-version.outputs.version }}
111+
files: clippath.exe
112+
generate_release_notes: true

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# dependencies
2+
node_modules
3+
.claude/
4+
5+
# output
6+
out
7+
dist
8+
builds
9+
tools
10+
*.tgz
11+
12+
# code coverage
13+
coverage
14+
*.lcov
15+
16+
# logs
17+
logs
18+
_.log
19+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
20+
21+
# dotenv environment variable files
22+
.env
23+
.env.development.local
24+
.env.test.local
25+
.env.production.local
26+
.env.local
27+
28+
# caches
29+
.eslintcache
30+
.cache
31+
*.tsbuildinfo
32+
33+
# IntelliJ based IDEs
34+
.idea
35+
36+
# Finder (MacOS) folder config
37+
.DS_Store

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "biomejs.biome",
4+
"explorer.fileNesting.enabled": true,
5+
"explorer.fileNesting.expand": false,
6+
"explorer.fileNesting.patterns": {
7+
"*.ts": "${capture}.test.ts"
8+
}
9+
}

0 commit comments

Comments
 (0)