Skip to content

Commit fa1b27d

Browse files
committed
fix(release): propagate semver to pkg-config outputs
1 parent 21bcefc commit fa1b27d

3 files changed

Lines changed: 35 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
outputs:
2222
release: ${{ steps.tag_release.outputs.release }}
2323
version: ${{ steps.tag_release.outputs.version }}
24+
tag: ${{ steps.tag_release.outputs.tag }}
2425
steps:
2526
- uses: actions/checkout@v6
2627
- name: Setup Node.js
@@ -40,7 +41,7 @@ jobs:
4041
echo "release=False" >> $GITHUB_OUTPUT
4142
else
4243
echo "release=True" >> $GITHUB_OUTPUT
43-
awk '/Published release/ { printf("version=v%s\n",$8) }' semantic-release.log >> $GITHUB_OUTPUT
44+
awk '/Published release/ { printf("version=%s\ntag=v%s\n",$8,$8) }' semantic-release.log >> $GITHUB_OUTPUT
4445
fi
4546
4647
linux-build:
@@ -57,7 +58,7 @@ jobs:
5758
- name: Build using cmake+ninja
5859
run: |
5960
mkdir build && cd build
60-
cmake -G "Ninja" ../
61+
cmake -G "Ninja" -D FREI0R_VERSION=${{ needs.semantic-release.outputs.version }} ../
6162
ninja
6263
- name: Upload linux filter
6364
uses: actions/upload-artifact@v6
@@ -79,6 +80,11 @@ jobs:
7980
with:
8081
name: release-linux-generator
8182
path: build/src/generator/**/*.so
83+
- name: Upload linux pkg-config
84+
uses: actions/upload-artifact@v6
85+
with:
86+
name: release-linux-pkgconfig
87+
path: build/frei0r.pc
8288

8389
win-build:
8490
name: 🪟 win64 build
@@ -95,7 +101,7 @@ jobs:
95101
- name: Build using nmake
96102
run: |
97103
mkdir build && cd build
98-
cmake -G "NMake Makefiles" -D WITHOUT_OPENCV=1 -D WITHOUT_CAIRO=1 -D WITHOUT_GAVL=1 ../
104+
cmake -G "NMake Makefiles" -D WITHOUT_OPENCV=1 -D WITHOUT_CAIRO=1 -D WITHOUT_GAVL=1 -D FREI0R_VERSION=${{ needs.semantic-release.outputs.version }} ../
99105
nmake
100106
- name: Upload win64 filter
101107
uses: actions/upload-artifact@v6
@@ -117,6 +123,11 @@ jobs:
117123
with:
118124
name: release-win64-generator
119125
path: build/src/generator/**/*.dll
126+
- name: Upload win64 pkg-config
127+
uses: actions/upload-artifact@v6
128+
with:
129+
name: release-win64-pkgconfig
130+
path: build/frei0r.pc
120131

121132
osx-build:
122133
name: 🍏 osx build
@@ -135,7 +146,7 @@ jobs:
135146
- name: Build using ninja
136147
run: |
137148
mkdir build && cd build
138-
cmake -G "Ninja" -D WITHOUT_OPENCV=1 -D WITHOUT_GAVL=1 ../
149+
cmake -G "Ninja" -D WITHOUT_OPENCV=1 -D WITHOUT_GAVL=1 -D FREI0R_VERSION=${{ needs.semantic-release.outputs.version }} ../
139150
ninja
140151
- name: Upload osx filter
141152
uses: actions/upload-artifact@v6
@@ -157,6 +168,11 @@ jobs:
157168
with:
158169
name: release-osx-generator
159170
path: build/src/generator/**/*.so
171+
- name: Upload osx pkg-config
172+
uses: actions/upload-artifact@v6
173+
with:
174+
name: release-osx-pkgconfig
175+
path: build/frei0r.pc
160176

161177
draft-binary-release:
162178
name: 📦 Pack release
@@ -183,6 +199,7 @@ jobs:
183199
cp ChangeLog $dst/ChangeLog.txt
184200
cp AUTHORS.md $dst/AUTHORS.txt
185201
cp include/frei0r.h include/frei0r.hpp $dst/
202+
cp frei0r-bin/release-win64-pkgconfig/frei0r.pc $dst/
186203
echo "${{ needs.semantic-release.outputs.version }}" > $dst/VERSION.txt
187204
zip -r -9 $dst.zip $dst
188205
@@ -197,6 +214,7 @@ jobs:
197214
cp ChangeLog $dst/ChangeLog.txt
198215
cp AUTHORS.md $dst/AUTHORS.txt
199216
cp include/frei0r.h include/frei0r.hpp $dst/
217+
cp frei0r-bin/release-osx-pkgconfig/frei0r.pc $dst/
200218
echo "${{ needs.semantic-release.outputs.version }}" > $dst/VERSION.txt
201219
zip -r -9 $dst.zip $dst
202220
@@ -211,6 +229,7 @@ jobs:
211229
cp ChangeLog $dst/ChangeLog.txt
212230
cp AUTHORS.md $dst/AUTHORS.txt
213231
cp include/frei0r.h include/frei0r.hpp $dst/
232+
cp frei0r-bin/release-linux-pkgconfig/frei0r.pc $dst/
214233
echo "${{ needs.semantic-release.outputs.version }}" > $dst/VERSION.txt
215234
tar cvfz $dst.tar.gz $dst
216235
@@ -223,7 +242,7 @@ jobs:
223242
*.zip
224243
*.tar.gz
225244
SHA256SUMS.txt
226-
tag_name: ${{ needs.semantic-release.outputs.version }}
245+
tag_name: ${{ needs.semantic-release.outputs.tag }}
227246
draft: true
228247
prerelease: false
229248
fail_on_unmatched_files: true

CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@ cmake_minimum_required (VERSION 3.12)
22

33
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
44

5-
project (frei0r)
6-
set (VERSION 2.5.1)
5+
set (FREI0R_VERSION "3.0.0" CACHE STRING "Project version in SemVer format")
6+
if (DEFINED ENV{FREI0R_VERSION} AND NOT "$ENV{FREI0R_VERSION}" STREQUAL "")
7+
set (FREI0R_VERSION "$ENV{FREI0R_VERSION}")
8+
endif ()
9+
string (REGEX REPLACE "^v" "" FREI0R_VERSION "${FREI0R_VERSION}")
10+
if (NOT FREI0R_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+$")
11+
message (FATAL_ERROR "FREI0R_VERSION must be a SemVer string like 3.0.0")
12+
endif ()
13+
14+
project (frei0r VERSION ${FREI0R_VERSION})
715
set (CMAKE_CXX_STANDARD 11)
816
set (CMAKE_CXX_STANDARD_REQUIRED True)
917

frei0r.pc.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ includedir=@includedir@
55

66
Name: frei0r
77
Description: minimalistic plugin API for video effects
8-
Version: @VERSION@
8+
Version: @PROJECT_VERSION@
99
Libs:
1010
Cflags: -I${includedir}
11-

0 commit comments

Comments
 (0)