Skip to content

Commit f466e12

Browse files
ndbroadbentclaude
andcommitted
Add GitHub Actions workflows for CI/CD
- Add CI workflow with matrix builds for Node 18.x, 20.x, and 22.x - Add manual release workflow for version management - Include build verification and artifact uploads - Configure workflows for the new Gulp 5 build system 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 23c9122 commit f466e12

File tree

2 files changed

+160
-0
lines changed

2 files changed

+160
-0
lines changed

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ '**' ] # Run on all branches
6+
pull_request:
7+
branches: [ master, main, develop ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x, 22.x]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run build
30+
run: npm run build
31+
32+
- name: Check build output
33+
run: |
34+
ls -la build/alpaca/bootstrap/
35+
test -f build/alpaca/bootstrap/alpaca.js
36+
test -f build/alpaca/bootstrap/alpaca.css
37+
38+
- name: Upload build artifacts
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: alpaca-build-node-${{ matrix.node-version }}
42+
path: |
43+
build/alpaca/
44+
dist/
45+
retention-days: 7
46+
47+
lint:
48+
runs-on: ubuntu-latest
49+
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- name: Use Node.js
54+
uses: actions/setup-node@v4
55+
with:
56+
node-version: '20.x'
57+
cache: 'npm'
58+
59+
- name: Install dependencies
60+
run: npm ci
61+
62+
- name: Run JSHint
63+
run: |
64+
# Create a simple lint task for now
65+
npx jshint src/js/**/*.js --config .jshintrc || echo "No .jshintrc found, skipping lint"
66+
continue-on-error: true
67+
68+
# Test job - currently minimal but can be expanded
69+
test:
70+
runs-on: ubuntu-latest
71+
72+
steps:
73+
- uses: actions/checkout@v4
74+
75+
- name: Use Node.js
76+
uses: actions/setup-node@v4
77+
with:
78+
node-version: '20.x'
79+
cache: 'npm'
80+
81+
- name: Install dependencies
82+
run: npm ci
83+
84+
- name: Run tests
85+
run: |
86+
# Add test commands when available
87+
echo "Tests will be added here"
88+
continue-on-error: true

.github/workflows/release.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_type:
7+
description: 'Version type (patch, minor, major)'
8+
required: true
9+
default: 'patch'
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
16+
jobs:
17+
release:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Use Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '20.x'
29+
cache: 'npm'
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Bump version
35+
run: |
36+
if [ "${{ github.event.inputs.version_type }}" = "major" ]; then
37+
npm run gulp bumpMajor
38+
elif [ "${{ github.event.inputs.version_type }}" = "minor" ]; then
39+
npm run gulp bumpMinor
40+
else
41+
npm run gulp bump
42+
fi
43+
44+
- name: Build
45+
run: npm run build
46+
47+
- name: Create dist
48+
run: npx gulp dist
49+
50+
- name: Get version
51+
id: version
52+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
53+
54+
- name: Create Release
55+
uses: actions/create-release@v1
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
with:
59+
tag_name: v${{ steps.version.outputs.version }}
60+
release_name: Release v${{ steps.version.outputs.version }}
61+
draft: false
62+
prerelease: false
63+
64+
- name: Upload Release Assets
65+
uses: actions/upload-release-asset@v1
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
with:
69+
upload_url: ${{ steps.create_release.outputs.upload_url }}
70+
asset_path: ./dist/alpaca.zip
71+
asset_name: alpaca-${{ steps.version.outputs.version }}.zip
72+
asset_content_type: application/zip

0 commit comments

Comments
 (0)