Skip to content

Commit

Permalink
Add workflow to build tagged releases and bump extension version to 0…
Browse files Browse the repository at this point in the history
….7-beta0

This also updates the readme in anticipation of the
build, and adds a couple of handy methods to the
API.

Beta 0 signifies the overall readiness, but I still need
to add notarization and codesign for macOS to the
mix.
  • Loading branch information
YuriSizov committed Jun 3, 2024
1 parent 7018463 commit 685e96a
Show file tree
Hide file tree
Showing 18 changed files with 214 additions and 16 deletions.
22 changes: 22 additions & 0 deletions .github/actions/make-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Make GitHub Release
description: Create a GitHub release as a draft, and generate its description.

inputs:
release-version:
required: true

runs:
using: "composite"
steps:
- name: Prepare release notes for this release
shell: bash
run: |
sed -i 's/\$\{COMMIT_HASH\}/${{ github.sha }}' $GITHUB_ACTION_PATH/release-notes.md
sed -i 's/\$\{VERSION_TAG\}/${{ inputs.release-version }}' $GITHUB_ACTION_PATH/release-notes.md
- name: Create a draft release with custom release notes
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create --verify-tag ${{ inputs.release-version }} --draft --title 'GDSiON ${{ inputs.release-version }}' --notes-file $GITHUB_ACTION_PATH/release-notes.md
31 changes: 31 additions & 0 deletions .github/actions/make-release/release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Built from commit [${COMMIT_HASH}](https://github.com/YuriSizov/gdsion/commits/${COMMIT_HASH}/). If you experience issues, [please report them](https://github.com/YuriSizov/gdsion/issues) as soon as you can.

## Downloads

* **[Download for Linux](https://github.com/YuriSizov/gdsion/releases/download/${VERSION_TAG}/libgdsion-linux.zip)**
* **[Download for macOS](https://github.com/YuriSizov/gdsion/releases/download/${VERSION_TAG}/libgdsion-macos.zip)**
* **[Download for Windows](https://github.com/YuriSizov/gdsion/releases/download/${VERSION_TAG}/libgdsion-windows.zip)**
* **[Download for Web](https://github.com/YuriSizov/gdsion/releases/download/${VERSION_TAG}/libgdsion-web.zip)** (requires _Godot 4.3-beta1_ or later)
* **[Download for Android](https://github.com/YuriSizov/gdsion/releases/download/${VERSION_TAG}/libgdsion-android.zip)**

_These archives contain GDSiON binaries for both debug and release exports._

## Installation

1. Extract the contents of the archive to your project's root folder.
2. Make sure that you now have a `bin` folder (i.e. `res://bin`), and that it contains `libgdsion.gdextension` and some other files starting with `libgdsion`.
3. Restart the editor.

You must download a build for each platform you plan on exporting to. The `libgdsion.gdextension` is the same in every download and can be safely overwritten when extracting multiple archives.

## Example project

The example project showcases one of many applications of the synthesizer library in an interactive way. It's the best way to start experimenting with GDSiON!

* [Download for Linux (x86_64)](https://github.com/YuriSizov/gdsion/releases/download/${VERSION_TAG}/example-project-linux-x86_64.zip)
* [Download for macOS (Universal)](https://github.com/YuriSizov/gdsion/releases/download/${VERSION_TAG}/example-project-macos-universal.zip)
* [Download for Windows (x86_64)](https://github.com/YuriSizov/gdsion/releases/download/${VERSION_TAG}/example-project-windows-x86_64.zip)
* [Download for Windows (x86_32)](https://github.com/YuriSizov/gdsion/releases/download/${VERSION_TAG}/example-project-windows-x86_32.zip)
* [Download project source](https://github.com/YuriSizov/gdsion/releases/download/${VERSION_TAG}/example-project-source.zip)

_The example project source archive contains GDSiON binaries for all platforms. It may be required for you to open the project twice to import everything correctly._
2 changes: 1 addition & 1 deletion .github/actions/update-release/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Update GitHub Release
description: Update the tag of an existing GH Release, and republish it.
description: Update the tag of an existing GitHub release, and republish it.

inputs:
release-version:
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/build-release-tagged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Build and Publish Tagged Release

on:
push:
tags:
# Match only tags that look like version numbers, e.g. 0.1, 2.3-beta, 4.5.6d, etc.
- '[0-9]+.[0-9]+*'

# Make sure jobs cannot overlap.
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:

# First, build the extension and upload the artifacts.

build-linux:
name: Compile and upload Linux version
uses: ./.github/workflows/extension-build-linux.yml
with:
git-base-ref: ${{ github.ref }}

build-macos:
name: Compile and upload macOS version
uses: ./.github/workflows/extension-build-macos.yml
with:
git-base-ref: ${{ github.ref }}

build-windows:
name: Compile and upload Windows version
uses: ./.github/workflows/extension-build-windows.yml
with:
git-base-ref: ${{ github.ref }}

build-web:
name: Compile and upload Web version
uses: ./.github/workflows/extension-build-web.yml
with:
git-base-ref: ${{ github.ref }}

build-android:
name: Compile and upload Android version
uses: ./.github/workflows/extension-build-android.yml
with:
git-base-ref: ${{ github.ref }}

# Then, make a draft release for the tag.

release-all:
name: Make a draft GitHub Release for the tag
needs: [ build-linux, build-macos, build-windows, build-web, build-android ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Make GitHub Release
uses: ./.github/actions/make-release
with:
release-version: ${{ github.ref }}

# Lastly, use the artifacts to prepare the example project and publish the build.

publish-all:
name: Package and publish the extension
needs: [ release-all ]
uses: ./.github/workflows/extension-publish-all.yml
with:
release-version: ${{ github.ref }}

export-example-project:
name: Export the example project for target platforms
needs: [ release-all ]
uses: ./.github/workflows/example-export-project.yml

publish-example-project:
name: Package and publish the example project
needs: [ export-example-project ]
uses: ./.github/workflows/example-publish-project.yml
with:
release-version: ${{ github.ref }}
10 changes: 10 additions & 0 deletions .github/workflows/build-release-unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,32 @@ jobs:
build-linux:
name: Compile and upload Linux version
uses: ./.github/workflows/extension-build-linux.yml
with:
git-base-ref: 'main'

build-macos:
name: Compile and upload macOS version
uses: ./.github/workflows/extension-build-macos.yml
with:
git-base-ref: 'main'

build-windows:
name: Compile and upload Windows version
uses: ./.github/workflows/extension-build-windows.yml
with:
git-base-ref: 'main'

build-web:
name: Compile and upload Web version
uses: ./.github/workflows/extension-build-web.yml
with:
git-base-ref: 'main'

build-android:
name: Compile and upload Android version
uses: ./.github/workflows/extension-build-android.yml
with:
git-base-ref: 'main'

# Then, use the artifacts to prepare the example project and publish the build.

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/extension-build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Build Extension - Android

on:
workflow_call:
inputs:
git-base-ref:
type: string
default: 'main'

# Make sure jobs cannot overlap.
concurrency:
Expand All @@ -18,7 +22,7 @@ jobs:
name: Compile and upload Android (${{ matrix.arch }}) version
runs-on: ubuntu-latest
env:
GIT_BASE_REF: 'main'
GIT_BASE_REF: ${{ inputs.git-base-ref }}
SCONS_PLATFORM: android
SCONS_PLATFORM_SUFFIX: ".${{ matrix.arch }}"

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/extension-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Build Extension - Linux

on:
workflow_call:
inputs:
git-base-ref:
type: string
default: 'main'

# Make sure jobs cannot overlap.
concurrency:
Expand All @@ -13,7 +17,7 @@ jobs:
name: Compile and upload Linux version
runs-on: ubuntu-latest
env:
GIT_BASE_REF: 'main'
GIT_BASE_REF: ${{ inputs.git-base-ref }}
SCONS_PLATFORM: linux

steps:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/extension-build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Build Extension - macOS

on:
workflow_call:
inputs:
git-base-ref:
type: string
default: 'main'

# Make sure jobs cannot overlap.
concurrency:
Expand All @@ -13,7 +17,7 @@ jobs:
name: Compile and upload macOS version
runs-on: macos-latest
env:
GIT_BASE_REF: 'main'
GIT_BASE_REF: ${{ inputs.git-base-ref }}
SCONS_PLATFORM: macos

steps:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/extension-build-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Build Extension - Web

on:
workflow_call:
inputs:
git-base-ref:
type: string
default: 'main'

# Make sure jobs cannot overlap.
concurrency:
Expand All @@ -13,7 +17,7 @@ jobs:
name: Compile and upload Web version
runs-on: ubuntu-latest
env:
GIT_BASE_REF: 'main'
GIT_BASE_REF: ${{ inputs.git-base-ref }}
SCONS_PLATFORM: web

steps:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/extension-build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Build Extension - Windows

on:
workflow_call:
inputs:
git-base-ref:
type: string
default: 'main'

# Make sure jobs cannot overlap.
concurrency:
Expand All @@ -18,7 +22,7 @@ jobs:
name: Compile and upload Windows (${{ matrix.arch }}) version
runs-on: windows-latest
env:
GIT_BASE_REF: 'main'
GIT_BASE_REF: ${{ inputs.git-base-ref }}
SCONS_PLATFORM: windows
SCONS_PLATFORM_SUFFIX: ".${{ matrix.arch }}"

Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@ The name of the synthesizer should be pronounced like the word "_scion_".

## Download

This project is feature complete, but there is no stable release available yet. You can download the **latest unstable** build and give it a try.
This project is in the _beta_ phase. This means it's feature complete, but still requires some bug fixing and testing. Please make backups when working with prerelease libraries! [Bug reports](https://github.com/YuriSizov/gdsion/issues) are highly appreciated.

The project is compatible with **Godot 4.3**.

As _Godot 4.3_ is still being developed, there might be compatibility issues between _GDSiON_ and available builds of the engine. The project has been developed and tested with the [4.3-dev5](https://godotengine.org/download/archive/4.3-dev5/) release, so this is the minimum recommended version for now.
> [!NOTE]
> As _Godot 4.3_ is still being developed, there might be compatibility issues between _GDSiON_ and available builds of the engine. The project has been developed and tested with the [4.3-dev5](https://godotengine.org/download/archive/4.3-dev5/) release, so this is the minimum recommended version for now.
### Current release: 0.7-beta0

* **[Download for Linux](https://github.com/YuriSizov/gdsion/releases/download/latest-unstable/libgdsion-linux.zip)**
* **[Download for macOS](https://github.com/YuriSizov/gdsion/releases/download/latest-unstable/libgdsion-macos.zip)**
* **[Download for Windows](https://github.com/YuriSizov/gdsion/releases/download/latest-unstable/libgdsion-windows.zip)**
* **[Download for Web](https://github.com/YuriSizov/gdsion/releases/download/latest-unstable/libgdsion-web.zip)** (requires _4.3-beta1_ or later)
* **[Download for Android](https://github.com/YuriSizov/gdsion/releases/download/latest-unstable/libgdsion-android.zip)**
* **[Download for Linux](https://github.com/YuriSizov/gdsion/releases/download/0.7-beta0/libgdsion-linux.zip)**
* **[Download for macOS](https://github.com/YuriSizov/gdsion/releases/download/0.7-beta0/libgdsion-macos.zip)**
* **[Download for Windows](https://github.com/YuriSizov/gdsion/releases/download/0.7-beta0/libgdsion-windows.zip)**
* **[Download for Web](https://github.com/YuriSizov/gdsion/releases/download/0.7-beta0/libgdsion-web.zip)** (requires _4.3-beta1_ or later)
* **[Download for Android](https://github.com/YuriSizov/gdsion/releases/download/0.7-beta0/libgdsion-android.zip)**

_These archives contain both release and debug binaries._

Please make backups when working with unstable libraries! [Bug reports](https://github.com/YuriSizov/gdsion/issues) are highly appreciated as well.
If you need the most recent fixes, you can also download the _[latest unstable](https://github.com/YuriSizov/gdsion/releases/latest-unstable)_ version, built from the latest commit of the `main` branch.

## Setup

Expand Down Expand Up @@ -52,7 +55,7 @@ driver.play("t100 l8 [ ccggaag4 ffeeddc4 | [ggffeed4]2 ]2")

You can also play a melody by directly feeding the driver your notes, one by one or as a sequence.

_GDSiON_ is capable of emulating a variety of instruments and algorithms, which you can configure for your playback. You can use `SiONVoicePresetUtil` to generate presets for over 500 instrument voices.
_GDSiON_ is capable of emulating a variety of instruments and algorithms, which you can configure for your playback. You can use `SiONVoicePresetUtil` to generate presets for over 650 instrument voices.

**Check the example project for an interactive demo!**

Expand Down
2 changes: 2 additions & 0 deletions example/globals/MusicPlayer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ func _init(controller: Node) -> void:
_driver = SiONDriver.create(controller.buffer_size)
controller.add_child(_driver)

print("Created synthesizer driver (v%s-%s)" % [ SiONDriver.get_version(), SiONDriver.get_version_flavor() ])


# Initialization.

Expand Down
3 changes: 3 additions & 0 deletions example/globals/VoiceManager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ var _drumkits: Array[Drumkit] = []


func _init() -> void:
# Generate presets with default flags.
_preset_util = SiONVoicePresetUtil.new()

# Full list of preset keys can be fetched with _preset_util.get_voice_preset_keys().
_register_voices()
_register_drumkits()

Expand Down
3 changes: 2 additions & 1 deletion example/gui/Visualizer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func _draw() -> void:

var offset := (size - RENDER_SIZE) / 2
var w := RENDER_SIZE.x / VU_COUNT
var prev_hz := 0
var prev_hz := 0.0

var new_heights := PackedFloat32Array()
var new_colors := PackedColorArray()
Expand All @@ -48,6 +48,7 @@ func _draw() -> void:
var height := _get_height(i - 1, magnitude)
var color := _get_color(i - 1, height)

@warning_ignore("integer_division")
var bar_position := Vector2(
offset.x + SPACE_WIDTH / 2 + w * (i - 1),
offset.y + RENDER_SIZE.y - height
Expand Down
8 changes: 8 additions & 0 deletions src/sion_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@

// TODO: Extract somewhere more manageable?
const char *SiONDriver::VERSION = "0.7.0.0"; // Original code is versioned 0.6.6.0.
const char *SiONDriver::VERSION_FLAVOR = "beta0";

SiONDriver *SiONDriver::_mutex = nullptr;
bool SiONDriver::_allow_multiple_drivers = false;

//

SiONDriver::SiONDriverJob::SiONDriverJob(String p_mml, Vector<double> p_buffer, const Ref<SiONData> &p_data, int p_channel_count, bool p_reset_effector) {
mml = p_mml;
buffer = p_buffer;
Expand Down Expand Up @@ -1183,6 +1186,11 @@ void SiONDriver::_bind_methods() {
ClassDB::bind_method(D_METHOD("_fade_callback", "value"), &SiONDriver::_fade_callback);
ClassDB::bind_method(D_METHOD("_fade_background_callback", "value"), &SiONDriver::_fade_callback);

//

ClassDB::bind_static_method("SiONDriver", D_METHOD("get_version"), &SiONDriver::get_version);
ClassDB::bind_static_method("SiONDriver", D_METHOD("get_version_flavor"), &SiONDriver::get_version_flavor);

// Factory.

ClassDB::bind_static_method("SiONDriver", D_METHOD("create", "buffer_size", "channel_num", "sample_rate", "bitrate"), &SiONDriver::create, DEFVAL(2048), DEFVAL(2), DEFVAL(44100), DEFVAL(0));
Expand Down
4 changes: 4 additions & 0 deletions src/sion_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class SiONDriver : public Node {

public:
static const char *VERSION;
static const char *VERSION_FLAVOR;

// Note-on exception modes.
enum ExceptionMode {
Expand Down Expand Up @@ -267,6 +268,9 @@ class SiONDriver : public Node {
void _notification(int p_what);

public:
static String get_version() { return VERSION; }
static String get_version_flavor() { return VERSION_FLAVOR; }

// The singleton instance.
static SiONDriver *get_mutex() { return _mutex; }
// NOTE: Godot doesn't support exposing constructors to the API, so we make do with a static factory method. Hopefully this can be fixed at some point.
Expand Down
Loading

0 comments on commit 685e96a

Please sign in to comment.