Skip to content

Commit 64e604e

Browse files
committed
feat: run all builds on master push with conventional commit auto-versioning
1 parent ae2e6ba commit 64e604e

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Build
33
on:
44
push:
55
branches: [master]
6-
tags: ["v*"]
76

87
jobs:
98
# ── Web (Emscripten → GitHub Pages) ─────────────────────────────────────────
@@ -53,7 +52,6 @@ jobs:
5352

5453
# ── Windows ─────────────────────────────────────────────────────────────────
5554
build-windows:
56-
if: startsWith(github.ref, 'refs/tags/')
5755
runs-on: windows-latest
5856
steps:
5957
- uses: actions/checkout@v4
@@ -88,7 +86,6 @@ jobs:
8886

8987
# ── Linux ────────────────────────────────────────────────────────────────────
9088
build-linux:
91-
if: startsWith(github.ref, 'refs/tags/')
9289
runs-on: ubuntu-latest
9390
steps:
9491
- uses: actions/checkout@v4
@@ -105,7 +102,6 @@ jobs:
105102
libwayland-dev wayland-protocols libxkbcommon-dev
106103
107104
- name: Configure CMake
108-
# Force X11 only — avoids needing wayland-scanner which isn't in PATH
109105
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DGLFW_BUILD_WAYLAND=OFF
110106

111107
- name: Build
@@ -125,7 +121,6 @@ jobs:
125121

126122
# ── macOS ────────────────────────────────────────────────────────────────────
127123
build-macos:
128-
if: startsWith(github.ref, 'refs/tags/')
129124
runs-on: macos-latest
130125
steps:
131126
- uses: actions/checkout@v4
@@ -134,9 +129,7 @@ jobs:
134129

135130
- name: Install Vulkan SDK + MoltenVK
136131
run: |
137-
# shaderc provides glslc, molten-vk provides the Vulkan ICD on macOS
138132
brew install vulkan-headers molten-vk shaderc
139-
# Add shaderc's glslc to PATH
140133
echo "$(brew --prefix shaderc)/bin" >> $GITHUB_PATH
141134
142135
- name: Configure CMake
@@ -163,7 +156,6 @@ jobs:
163156

164157
# ── Linux ARM64 ──────────────────────────────────────────────────────────────
165158
build-linux-arm64:
166-
if: startsWith(github.ref, 'refs/tags/')
167159
runs-on: ubuntu-24.04-arm
168160
steps:
169161
- uses: actions/checkout@v4
@@ -197,31 +189,44 @@ jobs:
197189
name: linux-arm64
198190
path: linux-arm64.zip
199191

200-
# ── Release ──────────────────────────────────────────────────────────────────
201-
release:
202-
if: startsWith(github.ref, 'refs/tags/')
203-
needs: [build-windows, build-linux, build-linux-arm64, build-macos]
192+
# ── Tag (conventional commits → semver) ──────────────────────────────────────
193+
tag:
194+
needs: [build-windows, build-linux, build-linux-arm64, build-macos, build-web]
204195
runs-on: ubuntu-latest
205196
permissions:
206197
contents: write
198+
outputs:
199+
new_tag: ${{ steps.bump.outputs.new_tag }}
207200
steps:
208201
- uses: actions/checkout@v4
209202
with:
210203
fetch-depth: 0
211204

205+
- name: Bump version and push tag
206+
id: bump
207+
uses: mathieudutour/github-tag-action@v6.2
208+
with:
209+
github_token: ${{ secrets.GITHUB_TOKEN }}
210+
default_bump: patch
211+
# feat: → minor, fix:/perf:/refactor: → patch
212+
# feat!: or "BREAKING CHANGE" in body → major
213+
214+
# ── Release ──────────────────────────────────────────────────────────────────
215+
release:
216+
needs: tag
217+
runs-on: ubuntu-latest
218+
permissions:
219+
contents: write
220+
steps:
212221
- uses: actions/download-artifact@v4
213222
with:
214223
path: artifacts
215-
216-
- name: Create tag (if needed)
217-
run: |
218-
git config user.name "github-actions"
219-
git config user.email "github-actions@github.com"
220-
git tag ${{ github.ref_name }} || true
221-
git push origin ${{ github.ref_name }} || true
224+
# exclude the github-pages artifact
225+
pattern: "!github-pages"
222226

223227
- uses: softprops/action-gh-release@v2
224228
with:
229+
tag_name: ${{ needs.tag.outputs.new_tag }}
225230
files: |
226231
artifacts/windows-x86_64/windows-x86_64.zip
227232
artifacts/linux-x86_64/linux-x86_64.zip

0 commit comments

Comments
 (0)