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
23 changes: 1 addition & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,4 @@ jobs:
with:
name: DrumMidiRemapper-${{ matrix.runtime }}
path: ./publish/${{ matrix.runtime }}

release:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts

- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.sha }}
name: Release ${{ github.sha }}
draft: false
prerelease: false
files: ./artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

40 changes: 40 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PR Validation

on:
pull_request:

jobs:
build-and-validate:
name: Build, Test & Validate
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Restore dependencies
run: dotnet restore

- name: Check code formatting
run: dotnet format --verify-no-changes

- name: Build with analyzers
run: dotnet build --configuration Release -warnaserror

- name: Run unit tests
run: dotnet test --no-build --verbosity normal

- name: Validate mapping JSON files
run: |
for file in $(find ./Services/Resources/Maps -name "*.json"); do
echo "Validating $file"
jq empty "$file"
done

- name: Check for vulnerable packages
run: dotnet list package --vulnerable
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
build-and-release:
name: Build and Release Binaries

strategy:
matrix:
include:
- os: windows-latest
rid: win-x64
ext: .exe
- os: macos-latest
rid: osx-x64
ext: ''
- os: macos-latest
rid: osx-arm64
ext: ''
- os: ubuntu-latest
rid: linux-x64
ext: ''

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Publish single-file binary
run: |
dotnet publish src/CLI \
-c Release \
-r ${{ matrix.rid }} \
--self-contained true \
/p:PublishSingleFile=true \
/p:IncludeAllContentForSelfExtract=true \
-o publish

- name: Rename binary
run: |
mv publish/CLI${{ matrix.ext }} publish/DrumMidiRemapper-${{ matrix.rid }}${{ matrix.ext }}

- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: publish/DrumMidiRemapper-${{ matrix.rid }}${{ matrix.ext }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}