Skip to content

Commit b3fab27

Browse files
committed
Add release workflow and upload artifacts
1 parent 85d0296 commit b3fab27

File tree

2 files changed

+126
-59
lines changed

2 files changed

+126
-59
lines changed

.github/workflows/build.yml

Lines changed: 84 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
pull_request:
77
branches: [ main ]
88
workflow_dispatch:
9+
workflow_call:
910

1011
jobs:
1112
build-and-test:
@@ -17,72 +18,96 @@ jobs:
1718
runs-on: ${{ matrix.os }}
1819

1920
steps:
20-
- name: Checkout code
21-
uses: actions/checkout@v4
22-
with:
23-
submodules: recursive
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: recursive
2425

25-
- name: Install dependencies (Linux)
26-
if: runner.os == 'Linux'
27-
run: |
28-
sudo apt-get update
29-
sudo apt-get install -y \
30-
build-essential \
31-
cmake \
32-
ninja-build \
33-
libasound2-dev \
34-
libjack-jackd2-dev \
35-
ladspa-sdk \
36-
libcurl4-openssl-dev \
37-
libfontconfig1-dev \
38-
libfreetype6-dev \
39-
libx11-dev \
40-
libxcomposite-dev \
41-
libxcursor-dev \
42-
libxext-dev \
43-
libxinerama-dev \
44-
libxrandr-dev \
45-
libxrender-dev \
46-
libglu1-mesa-dev \
47-
mesa-common-dev
26+
- name: Install dependencies (Linux)
27+
if: runner.os == 'Linux'
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y \
31+
build-essential \
32+
cmake \
33+
ninja-build \
34+
libasound2-dev \
35+
libjack-jackd2-dev \
36+
ladspa-sdk \
37+
libcurl4-openssl-dev \
38+
libfontconfig1-dev \
39+
libfreetype6-dev \
40+
libx11-dev \
41+
libxcomposite-dev \
42+
libxcursor-dev \
43+
libxext-dev \
44+
libxinerama-dev \
45+
libxrandr-dev \
46+
libxrender-dev \
47+
libglu1-mesa-dev \
48+
mesa-common-dev
4849
49-
- name: Install dependencies (macOS)
50-
if: runner.os == 'macOS'
51-
run: |
52-
brew install cmake ninja
50+
- name: Install dependencies (macOS)
51+
if: runner.os == 'macOS'
52+
run: |
53+
brew install cmake ninja
5354
54-
- name: Install dependencies (Windows)
55-
if: runner.os == 'Windows'
56-
run: |
57-
choco install cmake ninja -y
55+
- name: Install dependencies (Windows)
56+
if: runner.os == 'Windows'
57+
run: |
58+
choco install cmake ninja -y
5859
59-
- name: Setup MSVC environment (Windows)
60-
if: runner.os == 'Windows'
61-
uses: ilammy/msvc-dev-cmd@v1
62-
with:
63-
arch: x64
60+
- name: Setup MSVC environment (Windows)
61+
if: runner.os == 'Windows'
62+
uses: ilammy/msvc-dev-cmd@v1
63+
with:
64+
arch: x64
6465

65-
- name: Configure CMake (Windows)
66-
if: runner.os == 'Windows'
67-
run: |
68-
cmake -B build -G Ninja `
69-
-DCMAKE_C_COMPILER=cl `
70-
-DCMAKE_CXX_COMPILER=cl `
71-
-DCMAKE_BUILD_TYPE=Release
66+
- name: Configure CMake (Windows)
67+
if: runner.os == 'Windows'
68+
run: |
69+
cmake -B build -G Ninja `
70+
-DCMAKE_C_COMPILER=cl `
71+
-DCMAKE_CXX_COMPILER=cl `
72+
-DCMAKE_BUILD_TYPE=Release
7273
73-
- name: Configure CMake (macOS)
74-
if: runner.os == 'macOS'
75-
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/"
74+
- name: Configure CMake (macOS)
75+
if: runner.os == 'macOS'
76+
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/"
7677

77-
- name: Configure CMake (Linux)
78-
if: runner.os == 'Linux'
79-
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
78+
- name: Configure CMake (Linux)
79+
if: runner.os == 'Linux'
80+
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
8081

81-
- name: Build
82-
run: cmake --build build --config Release
82+
- name: Build
83+
run: cmake --build build --config Release
8384

84-
- name: Run tests
85-
run: ctest --test-dir build --output-on-failure
85+
- name: Run tests
86+
run: ctest --test-dir build --output-on-failure
8687

87-
- name: Installer
88-
run: cmake --build build --target installer --config Release
88+
- name: Installer
89+
run: cmake --build build --target installer --config Release
90+
91+
- name: Upload artifact (macOS)
92+
if: runner.os == 'macOS'
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: package-macos
96+
path: build/virtual-midi-controller*.dmg
97+
if-no-files-found: error
98+
99+
- name: Upload artifact (Linux)
100+
if: runner.os == 'Linux'
101+
uses: actions/upload-artifact@v4
102+
with:
103+
name: package-linux
104+
path: build/virtual-midi-controller*.deb
105+
if-no-files-found: error
106+
107+
- name: Upload artifact (Windows)
108+
if: runner.os == 'Windows'
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: package-windows
112+
path: build/virtual-midi-controller*.zip
113+
if-no-files-found: error

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]*.[0-9]*.[0-9]*[0-9A-Za-z_]*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Release version (e.g., v1.2.0) - only for manual testing'
11+
required: false
12+
default: 'Test-Release-Workflow'
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
build:
19+
uses: ./.github/workflows/build.yml
20+
secrets: inherit
21+
22+
release:
23+
needs: build
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Download build artifacts
27+
uses: actions/download-artifact@v4
28+
with:
29+
pattern: package-*
30+
path: artifacts
31+
merge-multiple: true
32+
33+
- name: Create GitHub Release
34+
uses: softprops/action-gh-release@v2
35+
with:
36+
tag_name: ${{ github.event.inputs.version || github.ref_name }}
37+
files: |
38+
artifacts/virtual-midi-controller*.dmg
39+
artifacts/virtual-midi-controller*.deb
40+
artifacts/virtual-midi-controller*.zip
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)