Skip to content

Commit 6452794

Browse files
committed
Move version to VERSION file, add tag.sh, update workflows for tag-based releases
1 parent d9f842e commit 6452794

File tree

7 files changed

+84
-7
lines changed

7 files changed

+84
-7
lines changed

.github/workflows/build_linux.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ on:
33
push:
44
branches:
55
- master
6-
- release
6+
- 'feature/*'
7+
tags:
8+
- 'v*'
79
jobs:
810
build:
911
name: Build Linux
@@ -23,3 +25,14 @@ jobs:
2325
shell: bash
2426
env:
2527
APIKEY: ${{ secrets.APIKEY }}
28+
- name: Upload Artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: SN76489_Linux
32+
path: ci/bin/*.zip
33+
retention-days: 30
34+
- name: Upload to GitHub Release
35+
if: startsWith(github.ref, 'refs/tags/v')
36+
uses: softprops/action-gh-release@v1
37+
with:
38+
files: ci/bin/*.zip

.github/workflows/build_macos.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Build macOS
2-
on: [push]
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- 'feature/*'
7+
tags:
8+
- 'v*'
39
jobs:
410
build:
511
name: Build macOS
@@ -26,3 +32,14 @@ jobs:
2632
APPLE_PASS: ${{ secrets.APPLE_PASS }}
2733
APPLE_USER: ${{ secrets.APPLE_USER }}
2834
APIKEY: ${{ secrets.APIKEY }}
35+
- name: Upload Artifact
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: SN76489_macOS
39+
path: ci/bin/*.zip
40+
retention-days: 30
41+
- name: Upload to GitHub Release
42+
if: startsWith(github.ref, 'refs/tags/v')
43+
uses: softprops/action-gh-release@v1
44+
with:
45+
files: ci/bin/*.zip

.github/workflows/build_windows.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Build Windows
2-
on: [push]
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- 'feature/*'
7+
tags:
8+
- 'v*'
39
jobs:
410
build:
511
name: Build Windows
@@ -19,3 +25,14 @@ jobs:
1925
shell: bash
2026
env:
2127
APIKEY: ${{ secrets.APIKEY }}
28+
- name: Upload Artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: SN76489_Windows
32+
path: ci/bin/*.zip
33+
retention-days: 30
34+
- name: Upload to GitHub Release
35+
if: startsWith(github.ref, 'refs/tags/v')
36+
uses: softprops/action-gh-release@v1
37+
with:
38+
files: ci/bin/*.zip

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ cmake_minimum_required (VERSION 3.24.0 FATAL_ERROR)
44
# Set for each plugin
55
#
66
set (PLUGIN_NAME SN76489)
7-
set (PLUGIN_VERSION 1.1.0)
7+
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" PLUGIN_VERSION)
8+
string(STRIP "${PLUGIN_VERSION}" PLUGIN_VERSION)
89
set (BUNDLE_ID com.socalabs.SN76489)
910
set (AU_ID SN76489AU)
1011
set (LV2_URI https://socalabs.com/sn76489/)

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.1.0

ci/build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if [ "$(uname)" == "Darwin" ]; then
7171
xcrun stapler staple $PLUGIN.component
7272
zip -r ${PLUGIN}_Mac.zip $PLUGIN.vst $PLUGIN.vst3 $PLUGIN.component
7373

74-
if [ "$BRANCH" = "release" ]; then
74+
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
7575
curl -F "files=@${PLUGIN}_Mac.zip" "https://socalabs.com/files/set.php?key=$APIKEY"
7676
fi
7777
fi
@@ -93,7 +93,7 @@ if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
9393
cd "$ROOT/ci/bin"
9494
zip -r ${PLUGIN}_Linux.zip $PLUGIN.so $PLUGIN.vst3 $PLUGIN.lv2
9595

96-
if [ "$BRANCH" = "release" ]; then
96+
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
9797
curl -F "files=@${PLUGIN}_Linux.zip" "https://socalabs.com/files/set.php?key=$APIKEY"
9898
fi
9999
fi
@@ -112,7 +112,7 @@ if [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
112112

113113
7z a ${PLUGIN}_Win.zip $PLUGIN.dll $PLUGIN.vst3
114114

115-
if [ "$BRANCH" = "release" ]; then
115+
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
116116
curl -F "files=@${PLUGIN}_Win.zip" "https://socalabs.com/files/set.php?key=$APIKEY"
117117
fi
118118
fi

tag.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd "$(dirname "$0")"
5+
6+
# Read version from VERSION file
7+
VERSION=$(cat VERSION | tr -d '[:space:]')
8+
9+
if [ -z "$VERSION" ]; then
10+
echo "Error: VERSION file is empty or not found"
11+
exit 1
12+
fi
13+
14+
TAG="v${VERSION}"
15+
16+
echo "Creating tag: $TAG"
17+
18+
# Check if tag already exists
19+
if git rev-parse "$TAG" >/dev/null 2>&1; then
20+
echo "Error: Tag $TAG already exists"
21+
exit 1
22+
fi
23+
24+
# Create and push the tag
25+
git tag -a "$TAG" -m "Release $VERSION"
26+
git push origin "$TAG"
27+
28+
echo "Tag $TAG created and pushed successfully"

0 commit comments

Comments
 (0)