Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 136 additions & 35 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,154 @@
name: Build and Publish Artifacts
name: Build Drum Midi Remapper (Windows/macOS/Linux)

on:
push:
branches: [ main ]
tags:
- 'v*'

permissions:
contents: write
- 'v*.*.*'
pull_request:
branches: [ main ]

jobs:
build:
version:
name: 🏷️ Generate Version
runs-on: ubuntu-latest
strategy:
matrix:
runtime: [win-x64, osx-x64, osx-arm64, linux-x64]

outputs:
version: ${{ steps.set-version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET 9 SDK
uses: actions/setup-dotnet@v3
- name: 🏷️ Generate semantic version from Git tag
id: set-version
run: |
TAG=$(git describe --tags --abbrev=0)
VERSION_BASE=${TAG#v}
COUNT=$(git rev-list --count ${TAG}..HEAD)
VERSION="$VERSION_BASE.$COUNT"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "📦 Using version: $VERSION"

build-windows:
name: Build Windows Desktop + CLI
runs-on: windows-latest
needs: version
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
dotnet-version: 8.0.x

- name: Install MAUI workloads
run: |
dotnet workload update
dotnet workload install maui
dotnet workload install maui-windows

- name: Restore dependencies
run: dotnet restore

- name: Publish single-file executable for ${{ matrix.runtime }}
- name: Build Windows MSIX
run: |
dotnet publish ./src/GUI/GUI.csproj -f net8.0-windows10.0.19041.0 -c Release `
-p:Version=${{ needs.version.outputs.version }} `
-p:WindowsPackageType=MSIX `
-p:GenerateAppxPackageOnBuild=true

- name: Build CLI
run: dotnet publish ./src/CLI/CLI.csproj -c Release -r win-x64 --self-contained true -p:Version=${{ needs.version.outputs.version }} -o ./cli-publish

- name: Package Windows MSIX
shell: pwsh
run: |
dotnet publish src/CLI \
-c Release \
-r ${{ matrix.runtime }} \
--self-contained true \
/p:PublishSingleFile=true \
/p:IncludeAllContentForSelfExtract=true \
-o ./publish/${{ matrix.runtime }}

- name: Upload artifact for ${{ matrix.runtime }}
uses: actions/upload-artifact@v4
$msix = Get-ChildItem -Path ./src/GUI/bin/Release/** -Recurse -Include "*.msix" | Select-Object -First 1
Compress-Archive -Path $msix.FullName -DestinationPath DrumMidiRemapper-Windows-${{ needs.version.outputs.version }}.zip

- uses: actions/upload-artifact@v4
with:
name: DrumMidiRemapper-Windows-${{ needs.version.outputs.version }}
path: |
DrumMidiRemapper-Windows-${{ needs.version.outputs.version }}.zip
./cli-publish/**

build-macos:
name: Build macOS Desktop + CLI
runs-on: macos-latest
needs: version
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
name: DrumMidiRemapper-${{ matrix.runtime }}
path: ./publish/${{ matrix.runtime }}
dotnet-version: 8.0.x

- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
files: ./publish/${{ matrix.runtime }}/CLI*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xcode-version: 'latest'

- name: Install MAUI workloads
run: |
dotnet workload update
dotnet workload install maui
dotnet workload install maui-maccatalyst

- name: Restore dependencies
run: dotnet workload restore

- name: Build MacCatalyst App
run: dotnet publish ./src/GUI/GUI.csproj -f net8.0-maccatalyst -c Release -p:Version=${{ needs.version.outputs.version }}

- name: Create DMG Installer
run: |
brew install create-dmg
APP_PATH=$(find ./src/GUI/bin/Release/net8.0-maccatalyst -name "*.app" | head -n 1)
echo "Found app: $APP_PATH"

if [[ "$APP_PATH" == *" "* ]]; then
APP_DIR=$(dirname "$APP_PATH")
APP_NEW="$APP_DIR/DrumMidiRemapper.app"
echo "Renaming app to: $APP_NEW"
mv "$APP_PATH" "$APP_NEW"
APP_PATH="$APP_NEW"
fi

create-dmg \
--volname "DrumMidiRemapper" \
--window-pos 200 120 \
--window-size 600 400 \
--no-internet-enable \
--skip-jenkins \
--icon-size 100 \
--icon "$APP_PATH" 175 190 \
--app-drop-link 425 190 \
"DrumMidiRemapper-${{ needs.version.outputs.version }}.dmg" \
"$APP_PATH"

- name: Build CLI
run: dotnet publish ./src/CLI/CLI.csproj -c Release -r osx-x64 --self-contained true -p:Version=${{ needs.version.outputs.version }} -o ./cli-publish

- uses: actions/upload-artifact@v4
with:
name: DrumMidiRemapper-macOS-${{ needs.version.outputs.version }}
path: |
DrumMidiRemapper-${{ needs.version.outputs.version }}.dmg
./cli-publish/**

# build-linux:
# name: Build Linux CLI only
# runs-on: ubuntu-latest
# needs: version
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-dotnet@v4
# with:
# dotnet-version: 8.0.x

# - name: Restore dependencies
# run: dotnet restore ./src/CLI/CLI.csproj

# - name: Build CLI Linux
# run: dotnet publish ./src/CLI/CLI.csproj -c Release --framework net8.0 --self-contained true -p:Version=${{ needs.version.outputs.version }} -o ./cli-publish --no-restore

# - uses: actions/upload-artifact@v4
# with:
# name: DrumMidiRemapper-LinuxCLI-${{ needs.version.outputs.version }}
# path: ./cli-publish/**
40 changes: 0 additions & 40 deletions .github/workflows/pr-validation.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -483,4 +483,4 @@ $RECYCLE.BIN/
# Vim temporary swap files
*.swp

midis/**
**/midis/**
33 changes: 17 additions & 16 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
},
{
"name": ".NET Core Launch (console)",
"name": "Launch CLI",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/CLI/bin/Debug/net9.0/CLI.dll",
"args": [],
"program": "${workspaceFolder}/src/CLI/bin/Debug/net8.0/CLI",
"cwd": "${workspaceFolder}/src/CLI",
"console": "internalConsole",
"stopAtEntry": false
"args": [
"GuitarPro",
"StevenSlate",
"${workspaceFolder}/midis/test.mid"
],
"console": "integratedTerminal"
},
{
"name": ".NET Core Attach",
"name": "Launch GUI (Mac Catalyst)",
"type": "coreclr",
"request": "attach"
"request": "launch",
"preLaunchTask": "build GUI (Mac Catalyst)",
"program": "${workspaceFolder}/src/GUI/bin/Debug/net8.0-maccatalyst/maccatalyst-arm64/DrumMidiRemapper.app/Contents/MacOS/DrumMidiRemapper",
"cwd": "${workspaceFolder}/src/GUI",
"internalConsoleOptions": "openOnSessionStart",
"env": {
"DOTNET_ROOT": "/usr/local/share/dotnet"
}
}
]
}
32 changes: 4 additions & 28 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,14 @@
"version": "2.0.0",
"tasks": [
{
"label": "build",
"label": "build GUI (Mac Catalyst)",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/drum-midi-remapper.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/drum-midi-remapper.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/drum-midi-remapper.sln"
"${workspaceFolder}/src/GUI/GUI.csproj",
"-f",
"net8.0-maccatalyst"
],
"problemMatcher": "$msCompile"
}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Drum MIDI Remapper

A **.NET 9** cross-platform tool for remapping MIDI drum notes between different standards and custom mappings. Designed to help musicians and producers adapt MIDI drum tracks for compatibility with various drum kits, DAWs, and hardware.
A **.NET 8** cross-platform tool for remapping MIDI drum notes between different standards and custom mappings. Designed to help musicians and producers adapt MIDI drum tracks for compatibility with various drum kits, DAWs, and hardware.

![Build Status](https://img.shields.io/github/actions/workflow/status/Abstractize/drum-midi-remapper/ci.yml?branch=main)
![License](https://img.shields.io/github/license/Abstractize/drum-midi-remapper)
Expand All @@ -22,7 +22,7 @@ dotnet run --project src/CLI -- GuitarPro StevenSlate midis/test.mid

## Requirements

- [.NET 9.0 SDK or newer](https://dotnet.microsoft.com/download)
- [.NET 8.0 SDK or newer](https://dotnet.microsoft.com/download)
- Compatible with Windows, macOS, and Linux

---
Expand All @@ -32,7 +32,7 @@ dotnet run --project src/CLI -- GuitarPro StevenSlate midis/test.mid
- Remap MIDI drum notes using customizable JSON mapping files
- Support for popular drum mapping standards (e.g., GuitarPro, StevenSlate, LogicPro, ProTools)
- Batch processing of MIDI files via CLI
- Cross-platform support powered by .NET 9
- Cross-platform support powered by .NET 8
- Modular architecture with Dependency Injection for easy extensibility

---
Expand Down Expand Up @@ -112,7 +112,7 @@ dotnet run --project src/CLI -- GuitarPro StevenSlate midis/test.mid

## Troubleshooting & FAQ

- **Build errors:** Ensure .NET 9 SDK is installed and your environment is configured correctly.
- **Build errors:** Ensure .NET 8 SDK is installed and your environment is configured correctly.
- **Mapping not found:** Verify spelling and that JSON mapping files exist in **Services/Resources/Maps/**.
- **MIDI file issues:** Confirm your input file is a valid MIDI file and accessible.

Expand Down
Loading
Loading