Skip to content

Commit 979df4f

Browse files
committed
feat: Add GitHub Actions CI/CD for Windows and macOS builds
- Builds CLAP, VST3 on Windows - Builds CLAP, VST3, AU on macOS (Universal binary) - Auto-creates GitHub releases when tags are pushed - Updated release.sh with --ci-only and --skip-local-build options
1 parent 12aa005 commit 979df4f

File tree

2 files changed

+236
-3
lines changed

2 files changed

+236
-3
lines changed

.github/workflows/build.yml

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
create_release:
10+
description: 'Create a release with artifacts'
11+
required: false
12+
default: 'false'
13+
14+
env:
15+
BUILD_TYPE: Release
16+
17+
jobs:
18+
build-macos:
19+
runs-on: macos-14 # Apple Silicon runner
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: recursive
25+
26+
- name: Setup CMake
27+
uses: lukka/get-cmake@latest
28+
29+
- name: Configure CMake
30+
run: |
31+
cmake -B build \
32+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
33+
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
34+
-DJAMWIDE_UNIVERSAL=ON \
35+
-DJAMWIDE_DEV_BUILD=OFF
36+
37+
- name: Build
38+
run: cmake --build build --config ${{ env.BUILD_TYPE }} -j $(sysctl -n hw.ncpu)
39+
40+
- name: Package artifacts
41+
run: |
42+
mkdir -p artifacts/macos
43+
44+
# Package CLAP
45+
cd build
46+
zip -r ../artifacts/macos/JamWide-macOS-CLAP.zip JamWide.clap
47+
48+
# Package VST3
49+
zip -r ../artifacts/macos/JamWide-macOS-VST3.zip JamWide.vst3
50+
51+
# Package AU
52+
zip -r ../artifacts/macos/JamWide-macOS-AU.zip JamWide.component
53+
54+
# Create combined package
55+
zip -r ../artifacts/macos/JamWide-macOS-All.zip JamWide.clap JamWide.vst3 JamWide.component
56+
57+
- name: Upload macOS artifacts
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: JamWide-macOS
61+
path: artifacts/macos/*.zip
62+
retention-days: 30
63+
64+
build-windows:
65+
runs-on: windows-latest
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v4
69+
with:
70+
submodules: recursive
71+
72+
- name: Setup CMake
73+
uses: lukka/get-cmake@latest
74+
75+
- name: Configure CMake
76+
run: |
77+
cmake -B build `
78+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
79+
-DJAMWIDE_DEV_BUILD=OFF
80+
81+
- name: Build
82+
run: cmake --build build --config ${{ env.BUILD_TYPE }} -j $env:NUMBER_OF_PROCESSORS
83+
84+
- name: Package artifacts
85+
shell: pwsh
86+
run: |
87+
New-Item -ItemType Directory -Force -Path artifacts/windows
88+
89+
# Package CLAP
90+
Compress-Archive -Path build/${{ env.BUILD_TYPE }}/JamWide.clap -DestinationPath artifacts/windows/JamWide-Windows-CLAP.zip
91+
92+
# Package VST3
93+
Compress-Archive -Path build/${{ env.BUILD_TYPE }}/JamWide.vst3 -DestinationPath artifacts/windows/JamWide-Windows-VST3.zip
94+
95+
# Create combined package
96+
Compress-Archive -Path build/${{ env.BUILD_TYPE }}/JamWide.clap, build/${{ env.BUILD_TYPE }}/JamWide.vst3 -DestinationPath artifacts/windows/JamWide-Windows-All.zip
97+
98+
- name: Upload Windows artifacts
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: JamWide-Windows
102+
path: artifacts/windows/*.zip
103+
retention-days: 30
104+
105+
release:
106+
needs: [build-macos, build-windows]
107+
runs-on: ubuntu-latest
108+
if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.create_release == 'true'
109+
permissions:
110+
contents: write
111+
steps:
112+
- name: Checkout
113+
uses: actions/checkout@v4
114+
115+
- name: Download all artifacts
116+
uses: actions/download-artifact@v4
117+
with:
118+
path: artifacts
119+
120+
- name: Get version from tag
121+
id: get_version
122+
run: |
123+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
124+
VERSION=${GITHUB_REF#refs/tags/}
125+
else
126+
VERSION="dev-$(date +%Y%m%d-%H%M%S)"
127+
fi
128+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
129+
130+
- name: Generate release notes
131+
id: release_notes
132+
run: |
133+
# Get build number from source
134+
BUILD_NUM=$(grep -o 'JAMWIDE_BUILD_NUMBER [0-9]*' src/build_number.h | awk '{print $2}' || echo "unknown")
135+
136+
cat << EOF > release_notes.md
137+
## JamWide ${{ steps.get_version.outputs.VERSION }}
138+
139+
**Build:** r${BUILD_NUM}
140+
141+
### Downloads
142+
143+
#### macOS (Universal: Apple Silicon + Intel)
144+
- **JamWide-macOS-All.zip** - All formats (CLAP, VST3, AU)
145+
- **JamWide-macOS-CLAP.zip** - CLAP only
146+
- **JamWide-macOS-VST3.zip** - VST3 only
147+
- **JamWide-macOS-AU.zip** - Audio Unit only
148+
149+
#### Windows (x64)
150+
- **JamWide-Windows-All.zip** - All formats (CLAP, VST3)
151+
- **JamWide-Windows-CLAP.zip** - CLAP only
152+
- **JamWide-Windows-VST3.zip** - VST3 only
153+
154+
### Installation
155+
156+
**macOS:**
157+
- CLAP: \`~/Library/Audio/Plug-Ins/CLAP/\`
158+
- VST3: \`~/Library/Audio/Plug-Ins/VST3/\`
159+
- AU: \`~/Library/Audio/Plug-Ins/Components/\`
160+
161+
**Windows:**
162+
- CLAP: \`C:\\Program Files\\Common Files\\CLAP\\\`
163+
- VST3: \`C:\\Program Files\\Common Files\\VST3\\\`
164+
165+
---
166+
167+
⚠️ **Early Development** - Not yet ready for production use
168+
EOF
169+
170+
- name: Create Release
171+
uses: softprops/action-gh-release@v2
172+
with:
173+
name: JamWide ${{ steps.get_version.outputs.VERSION }}
174+
body_path: release_notes.md
175+
draft: false
176+
prerelease: true
177+
files: |
178+
artifacts/JamWide-macOS/*.zip
179+
artifacts/JamWide-Windows/*.zip
180+
env:
181+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release.sh

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# JamWide Release Script
44
# Automatically generates commit summary, commits, builds, tags, and pushes to GitHub
5+
# When a tag is pushed, GitHub Actions will build for Windows and macOS and upload to releases
56
#
67

78
set -e # Exit on error
@@ -15,6 +16,33 @@ YELLOW='\033[1;33m'
1516
CYAN='\033[0;36m'
1617
NC='\033[0m' # No Color
1718

19+
# Parse arguments
20+
SKIP_LOCAL_BUILD=false
21+
CI_ONLY=false
22+
23+
for arg in "$@"; do
24+
case $arg in
25+
--ci-only)
26+
CI_ONLY=true
27+
SKIP_LOCAL_BUILD=true
28+
shift
29+
;;
30+
--skip-local-build)
31+
SKIP_LOCAL_BUILD=true
32+
shift
33+
;;
34+
--help)
35+
echo "Usage: $0 [options]"
36+
echo ""
37+
echo "Options:"
38+
echo " --skip-local-build Skip local build, only commit and tag"
39+
echo " --ci-only Only push tag to trigger CI build (no local build)"
40+
echo " --help Show this help"
41+
exit 0
42+
;;
43+
esac
44+
done
45+
1846
# Get current build number
1947
BUILD_NUM=$(grep -o 'JAMWIDE_BUILD_NUMBER [0-9]*' src/build_number.h | awk '{print $2}')
2048

@@ -128,8 +156,22 @@ fi
128156

129157
# Build and install
130158
echo ""
131-
echo -e "${YELLOW}Building...${NC}"
132-
./install.sh
159+
if [[ "$SKIP_LOCAL_BUILD" == "true" ]]; then
160+
echo -e "${YELLOW}Skipping local build (--skip-local-build or --ci-only)${NC}"
161+
# Still increment build number for consistency
162+
./increment_build.sh 2>/dev/null || {
163+
BUILD_FILE="src/build_number.h"
164+
if [ -f "$BUILD_FILE" ]; then
165+
CURRENT=$(grep JAMWIDE_BUILD_NUMBER "$BUILD_FILE" | grep -o '[0-9]*')
166+
NEW=$((CURRENT + 1))
167+
echo "#pragma once" > "$BUILD_FILE"
168+
echo "#define JAMWIDE_BUILD_NUMBER $NEW" >> "$BUILD_FILE"
169+
fi
170+
}
171+
else
172+
echo -e "${YELLOW}Building locally...${NC}"
173+
./install.sh
174+
fi
133175

134176
# Get new build number after install
135177
NEW_BUILD_NUM=$(grep -o 'JAMWIDE_BUILD_NUMBER [0-9]*' src/build_number.h | awk '{print $2}')
@@ -170,4 +212,14 @@ fi
170212
echo ""
171213
echo -e "${GREEN}=== Release Complete ===${NC}"
172214
echo -e "Build: r${NEW_BUILD_NUM}"
173-
echo -e "Installed to: ~/Library/Audio/Plug-Ins/CLAP/JamWide.clap"
215+
if [[ "$SKIP_LOCAL_BUILD" != "true" ]]; then
216+
echo -e "Installed to: ~/Library/Audio/Plug-Ins/CLAP/JamWide.clap"
217+
fi
218+
219+
# Show CI status if tag was created
220+
if [[ -n "$TAG_NAME" ]] && git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
221+
echo ""
222+
echo -e "${CYAN}GitHub Actions will now build for Windows and macOS.${NC}"
223+
echo -e "View progress: https://github.com/mkschulze/JamWide/actions"
224+
echo -e "Release will appear at: https://github.com/mkschulze/JamWide/releases/tag/${TAG_NAME}"
225+
fi

0 commit comments

Comments
 (0)