Skip to content

Commit 667bcae

Browse files
committed
major commit
1 parent 07a4c35 commit 667bcae

43 files changed

Lines changed: 2844 additions & 496 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/ci.yml

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
tags: ['v*']
7+
pull_request:
8+
branches: [main]
9+
10+
env:
11+
BUILD_TYPE: Release
12+
13+
jobs:
14+
# ==========================================================================
15+
# Version Extraction
16+
# ==========================================================================
17+
version:
18+
name: Extract Version
19+
runs-on: ubuntu-latest
20+
outputs:
21+
version: ${{ steps.version.outputs.version }}
22+
version_full: ${{ steps.version.outputs.version_full }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Get version from VERSION file
29+
id: version
30+
run: |
31+
VERSION=$(cat VERSION | tr -d '\n\r')
32+
echo "version=$VERSION" >> $GITHUB_OUTPUT
33+
34+
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
35+
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
36+
echo "version_full=$TAG_VERSION" >> $GITHUB_OUTPUT
37+
elif [[ "${{ github.ref }}" == refs/heads/* ]]; then
38+
BRANCH="${GITHUB_REF#refs/heads/}"
39+
SHORT_SHA="${GITHUB_SHA::7}"
40+
echo "version_full=$VERSION-$BRANCH-$SHORT_SHA" >> $GITHUB_OUTPUT
41+
else
42+
echo "version_full=$VERSION-dev" >> $GITHUB_OUTPUT
43+
fi
44+
45+
# ==========================================================================
46+
# Build Jobs
47+
# ==========================================================================
48+
build:
49+
name: Build (${{ matrix.os }})
50+
needs: version
51+
runs-on: ${{ matrix.os }}
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
include:
56+
- os: ubuntu-22.04
57+
artifact_name: vibeymaptools-linux
58+
archive_ext: .tar.gz
59+
- os: windows-2022
60+
artifact_name: vibeymaptools-windows
61+
archive_ext: .zip
62+
- os: macos-14
63+
artifact_name: vibeymaptools-macos
64+
archive_ext: .tar.gz
65+
66+
steps:
67+
- uses: actions/checkout@v4
68+
with:
69+
submodules: recursive
70+
fetch-depth: 0
71+
72+
# ---- Linux Setup ----
73+
- name: 'Linux: Install dependencies'
74+
if: startsWith(matrix.os, 'ubuntu-')
75+
run: |
76+
sudo apt update
77+
sudo apt install -y qt6-base-dev libgl1-mesa-dev libtbb-dev libembree-dev
78+
79+
# ---- macOS Setup ----
80+
- name: 'macOS: Install Qt6'
81+
if: startsWith(matrix.os, 'macos-')
82+
uses: jurplel/install-qt-action@v4
83+
with:
84+
version: 6.4.3
85+
86+
- name: 'macOS: Install dependencies'
87+
if: startsWith(matrix.os, 'macos-')
88+
run: |
89+
brew install tbb embree
90+
91+
# ---- Windows Setup ----
92+
- name: 'Windows: Setup MSVC'
93+
if: startsWith(matrix.os, 'windows-')
94+
uses: ilammy/msvc-dev-cmd@v1
95+
96+
- name: 'Windows: Install Qt6'
97+
if: startsWith(matrix.os, 'windows-')
98+
uses: jurplel/install-qt-action@v4
99+
with:
100+
version: 6.7.0
101+
102+
# ---- Build ----
103+
- name: Configure CMake
104+
run: |
105+
cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
106+
107+
- name: Build
108+
run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel
109+
110+
- name: Run Tests
111+
run: ctest --test-dir build --output-on-failure --build-config ${{ env.BUILD_TYPE }}
112+
113+
- name: Package
114+
run: cmake --build build --target package --config ${{ env.BUILD_TYPE }}
115+
116+
# ---- Upload Artifacts ----
117+
- name: Upload Artifact
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: ${{ matrix.artifact_name }}-${{ needs.version.outputs.version_full }}
121+
path: build/VibeyMapTools-*${{ matrix.archive_ext }}
122+
if-no-files-found: warn
123+
124+
# ==========================================================================
125+
# Release Job
126+
# ==========================================================================
127+
release:
128+
name: Create Release
129+
needs: [version, build]
130+
if: startsWith(github.ref, 'refs/tags/v')
131+
runs-on: ubuntu-latest
132+
permissions:
133+
contents: write
134+
135+
steps:
136+
- uses: actions/checkout@v4
137+
138+
- name: Download all artifacts
139+
uses: actions/download-artifact@v4
140+
with:
141+
path: artifacts
142+
143+
- name: Generate Release Notes
144+
id: notes
145+
run: |
146+
VERSION="${{ needs.version.outputs.version }}"
147+
cat << 'EOF' > release_notes.md
148+
# VibeyMapTools ${{ needs.version.outputs.version }}
149+
150+
## Downloads
151+
152+
| Platform | Download |
153+
|----------|----------|
154+
| Windows | `vibeymaptools-windows-${{ needs.version.outputs.version_full }}.zip` |
155+
| Linux | `vibeymaptools-linux-${{ needs.version.outputs.version_full }}.tar.gz` |
156+
| macOS | `vibeymaptools-macos-${{ needs.version.outputs.version_full }}.tar.gz` |
157+
158+
## What's New
159+
160+
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details.
161+
162+
## Features
163+
164+
- GPU-accelerated raytracing (OptiX)
165+
- Intel OIDN denoising
166+
- Stochastic light sampling
167+
- Incremental lighting
168+
- HDR lightmap support
169+
EOF
170+
171+
- name: Create GitHub Release
172+
uses: softprops/action-gh-release@v2
173+
with:
174+
name: VibeyMapTools ${{ needs.version.outputs.version }}
175+
body_path: release_notes.md
176+
draft: true
177+
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }}
178+
files: |
179+
artifacts/**/*
180+
181+
# ==========================================================================
182+
# Nightly Build
183+
# ==========================================================================
184+
nightly:
185+
name: Nightly Build
186+
if: github.event_name == 'schedule' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
187+
needs: [version, build]
188+
runs-on: ubuntu-latest
189+
permissions:
190+
contents: write
191+
192+
steps:
193+
- uses: actions/checkout@v4
194+
195+
- name: Download all artifacts
196+
uses: actions/download-artifact@v4
197+
with:
198+
path: artifacts
199+
200+
- name: Update Nightly Release
201+
uses: andelf/nightly-release@main
202+
env:
203+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
204+
with:
205+
tag_name: nightly
206+
name: 'Nightly Build'
207+
prerelease: true
208+
body: |
209+
Automated nightly build from main branch.
210+
Version: ${{ needs.version.outputs.version_full }}
211+
Commit: ${{ github.sha }}
212+
files: |
213+
artifacts/**/*

.github/workflows/release.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Release Automation
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_bump:
7+
description: 'Version bump type'
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
prerelease:
15+
description: 'Pre-release tag (empty for stable)'
16+
required: false
17+
type: string
18+
default: ''
19+
20+
permissions:
21+
contents: write
22+
23+
jobs:
24+
bump-version:
25+
name: Bump Version and Create Tag
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Configure Git
34+
run: |
35+
git config user.name "github-actions[bot]"
36+
git config user.email "github-actions[bot]@users.noreply.github.com"
37+
38+
- name: Bump version
39+
id: bump
40+
run: |
41+
CURRENT_VERSION=$(cat VERSION | tr -d '\n\r')
42+
IFS='.' read -ra PARTS <<< "$CURRENT_VERSION"
43+
MAJOR="${PARTS[0]}"
44+
MINOR="${PARTS[1]}"
45+
PATCH="${PARTS[2]}"
46+
47+
case "${{ inputs.version_bump }}" in
48+
major)
49+
MAJOR=$((MAJOR + 1))
50+
MINOR=0
51+
PATCH=0
52+
;;
53+
minor)
54+
MINOR=$((MINOR + 1))
55+
PATCH=0
56+
;;
57+
patch)
58+
PATCH=$((PATCH + 1))
59+
;;
60+
esac
61+
62+
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
63+
64+
if [[ -n "${{ inputs.prerelease }}" ]]; then
65+
TAG_VERSION="$NEW_VERSION-${{ inputs.prerelease }}"
66+
else
67+
TAG_VERSION="$NEW_VERSION"
68+
fi
69+
70+
echo "$NEW_VERSION" > VERSION
71+
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
72+
echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT
73+
74+
echo "Bumped version: $CURRENT_VERSION -> $TAG_VERSION"
75+
76+
- name: Update CHANGELOG.md
77+
run: |
78+
DATE=$(date +%Y-%m-%d)
79+
VERSION="${{ steps.bump.outputs.tag_version }}"
80+
81+
# Replace "Unreleased" with version and date
82+
sed -i "s/## 2.1.0 (Unreleased)/## $VERSION ($DATE)/" CHANGELOG.md
83+
84+
# Add new Unreleased section
85+
sed -i "1a\\n## Unreleased\\n" CHANGELOG.md
86+
87+
- name: Commit version bump
88+
run: |
89+
git add VERSION CHANGELOG.md
90+
git commit -m "chore: bump version to ${{ steps.bump.outputs.tag_version }}"
91+
git push
92+
93+
- name: Create and push tag
94+
run: |
95+
git tag -a "v${{ steps.bump.outputs.tag_version }}" -m "Release v${{ steps.bump.outputs.tag_version }}"
96+
git push origin "v${{ steps.bump.outputs.tag_version }}"
97+
98+
- name: Summary
99+
run: |
100+
echo "## Version Bump Complete" >> $GITHUB_STEP_SUMMARY
101+
echo "" >> $GITHUB_STEP_SUMMARY
102+
echo "- New version: **${{ steps.bump.outputs.tag_version }}**" >> $GITHUB_STEP_SUMMARY
103+
echo "- Tag: **v${{ steps.bump.outputs.tag_version }}**" >> $GITHUB_STEP_SUMMARY
104+
echo "" >> $GITHUB_STEP_SUMMARY
105+
echo "The CI workflow will now build and create the release." >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)