From 93b1d16b95b907b769eae7239336ed222e09875e Mon Sep 17 00:00:00 2001 From: Abstractize Date: Wed, 2 Jul 2025 15:36:08 -0600 Subject: [PATCH 1/4] Add Release Workflow --- .github/workflows/build.yml | 23 +------------- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cabf07f..c32c7bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }} \ No newline at end of file + \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cbd3ad9 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} \ No newline at end of file From 87986754a5c628dc47d16b2f48199fcfc13e3e00 Mon Sep 17 00:00:00 2001 From: Abstractize Date: Wed, 2 Jul 2025 15:40:54 -0600 Subject: [PATCH 2/4] Add PR Validation --- .github/workflows/pr-validation.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/pr-validation.yml diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml new file mode 100644 index 0000000..dab2da8 --- /dev/null +++ b/.github/workflows/pr-validation.yml @@ -0,0 +1,28 @@ +name: PR Validation + +on: + pull_request: + +jobs: + build-and-test: + name: Build and Test + + 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: Build the solution + run: dotnet build --configuration Release --no-restore + + - name: Run unit tests + run: dotnet test --no-build --verbosity normal \ No newline at end of file From 8589aaa3459d109530d6b6001131a9063dd65b8c Mon Sep 17 00:00:00 2001 From: Abstractize Date: Wed, 2 Jul 2025 15:44:32 -0600 Subject: [PATCH 3/4] Update PR Validation --- .github/workflows/pr-validation.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index dab2da8..6071b71 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -4,9 +4,8 @@ on: pull_request: jobs: - build-and-test: - name: Build and Test - + build-and-validate: + name: Build, Test & Validate runs-on: ubuntu-latest steps: @@ -21,8 +20,21 @@ jobs: - name: Restore dependencies run: dotnet restore - - name: Build the solution - run: dotnet build --configuration Release --no-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 \ No newline at end of file + run: dotnet test --no-build --verbosity normal + + - name: Validate mapping JSON files + run: | + for file in $(find . -name "*.json"); do + echo "Validating $file" + jq empty "$file" + done + + - name: Check for vulnerable packages + run: dotnet list package --vulnerable \ No newline at end of file From 08aa90442bb021ea27da7646ca4893df87e0f72c Mon Sep 17 00:00:00 2001 From: Abstractize Date: Wed, 2 Jul 2025 15:49:53 -0600 Subject: [PATCH 4/4] Update PR Validation --- .github/workflows/pr-validation.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 6071b71..4f55358 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -31,10 +31,10 @@ jobs: - name: Validate mapping JSON files run: | - for file in $(find . -name "*.json"); do - echo "Validating $file" - jq empty "$file" - done + 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 \ No newline at end of file