From 4b2c6c711e5e59f94457ad051d15c25c8f7c5d9e Mon Sep 17 00:00:00 2001 From: Switch <31280229+gavin1970@users.noreply.github.com> Date: Sat, 7 Mar 2026 19:47:15 -0500 Subject: [PATCH 1/2] Adding release.yml for 'git tag v6.xx.xx.xx' and 'git push origin v6.xx.xx.x' is used. --- .github/workflows/ci.yml | 32 ++++++++++++++---- .github/workflows/release.yml | 63 +++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2af732..f7778ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,9 +3,14 @@ name: CI on: push: branches: [ "main" ] + tags: + - "v*" pull_request: branches: [ "main" ] +permissions: + contents: write + concurrency: group: ci-${{ github.ref }} cancel-in-progress: true @@ -30,7 +35,7 @@ jobs: - name: Setup .NET 8 uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: "8.0.x" - name: Restore run: msbuild Colors.Dev.sln /t:Restore /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} @@ -38,11 +43,24 @@ jobs: - name: Build run: msbuild Colors.Dev.sln /m /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} - - name: Upload build artifacts + - name: Package + if: matrix.configuration == 'Release' + shell: pwsh + run: | + New-Item -ItemType Directory -Force -Path release | Out-Null + Copy-Item "${{ matrix.platform }}/${{ matrix.configuration }}/Colors.Dev.dll" -Destination release + Copy-Item "${{ matrix.platform }}/${{ matrix.configuration }}/Colors.Dev.lib" -Destination release + Copy-Item "*.h" -Destination release -ErrorAction SilentlyContinue + + - name: Upload artifact + if: matrix.configuration == 'Release' uses: actions/upload-artifact@v4 with: - name: Colors.Dev-${{ matrix.configuration }}-${{ matrix.platform }} - path: | - **/bin/${{ matrix.platform }}/${{ matrix.configuration }}/** - **/${{ matrix.platform }}/${{ matrix.configuration }}/** - if-no-files-found: warn + name: Colors.Dev-${{ github.ref_name }}-${{ matrix.platform }} + path: release + + - name: Create GitHub Release + if: startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release' + uses: softprops/action-gh-release@v2 + with: + files: release/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..95dce2d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,63 @@ +name: CI + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: windows-latest + + strategy: + fail-fast: false + matrix: + configuration: [Debug, Release] + platform: [x64] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + + - name: Setup .NET 8 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" + + - name: Restore + run: msbuild Colors.Dev.sln /t:Restore /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} + + - name: Build + run: msbuild Colors.Dev.sln /m /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} + + - name: Package + if: matrix.configuration == 'Release' + shell: pwsh + run: | + New-Item -ItemType Directory -Force -Path release | Out-Null + Copy-Item "${{ matrix.platform }}/${{ matrix.configuration }}/Colors.Dev.dll" -Destination release + Copy-Item "${{ matrix.platform }}/${{ matrix.configuration }}/Colors.Dev.lib" -Destination release + Copy-Item "*.h" -Destination release -ErrorAction SilentlyContinue + + - name: Upload artifact + if: matrix.configuration == 'Release' + uses: actions/upload-artifact@v4 + with: + name: Colors.Dev-${{ github.ref_name }}-${{ matrix.platform }} + path: release + + - name: Create GitHub Release + if: startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release' + uses: softprops/action-gh-release@v2 + with: + files: release/* From 16c327de2fd6700c8299a98ca9ecbdb4a8588a7d Mon Sep 17 00:00:00 2001 From: Switch <31280229+gavin1970@users.noreply.github.com> Date: Sat, 7 Mar 2026 19:52:07 -0500 Subject: [PATCH 2/2] refactor release.yml and ci.yml --- .github/workflows/ci.yml | 27 --------------------------- .github/workflows/release.yml | 31 ++++++------------------------- 2 files changed, 6 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7778ee..9ba146f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,14 +3,9 @@ name: CI on: push: branches: [ "main" ] - tags: - - "v*" pull_request: branches: [ "main" ] -permissions: - contents: write - concurrency: group: ci-${{ github.ref }} cancel-in-progress: true @@ -42,25 +37,3 @@ jobs: - name: Build run: msbuild Colors.Dev.sln /m /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} - - - name: Package - if: matrix.configuration == 'Release' - shell: pwsh - run: | - New-Item -ItemType Directory -Force -Path release | Out-Null - Copy-Item "${{ matrix.platform }}/${{ matrix.configuration }}/Colors.Dev.dll" -Destination release - Copy-Item "${{ matrix.platform }}/${{ matrix.configuration }}/Colors.Dev.lib" -Destination release - Copy-Item "*.h" -Destination release -ErrorAction SilentlyContinue - - - name: Upload artifact - if: matrix.configuration == 'Release' - uses: actions/upload-artifact@v4 - with: - name: Colors.Dev-${{ github.ref_name }}-${{ matrix.platform }} - path: release - - - name: Create GitHub Release - if: startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release' - uses: softprops/action-gh-release@v2 - with: - files: release/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95dce2d..94766c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: CI +name: Release on: push: @@ -8,20 +8,10 @@ on: permissions: contents: write -concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true - jobs: - build: + release: runs-on: windows-latest - strategy: - fail-fast: false - matrix: - configuration: [Debug, Release] - platform: [x64] - steps: - name: Checkout uses: actions/checkout@v4 @@ -35,29 +25,20 @@ jobs: dotnet-version: "8.0.x" - name: Restore - run: msbuild Colors.Dev.sln /t:Restore /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} + run: msbuild Colors.Dev.sln /t:Restore /p:Configuration=Release /p:Platform=x64 - name: Build - run: msbuild Colors.Dev.sln /m /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} + run: msbuild Colors.Dev.sln /m /p:Configuration=Release /p:Platform=x64 - name: Package - if: matrix.configuration == 'Release' shell: pwsh run: | New-Item -ItemType Directory -Force -Path release | Out-Null - Copy-Item "${{ matrix.platform }}/${{ matrix.configuration }}/Colors.Dev.dll" -Destination release - Copy-Item "${{ matrix.platform }}/${{ matrix.configuration }}/Colors.Dev.lib" -Destination release + Copy-Item "x64/Release/Colors.Dev.dll" -Destination release + Copy-Item "x64/Release/Colors.Dev.lib" -Destination release Copy-Item "*.h" -Destination release -ErrorAction SilentlyContinue - - name: Upload artifact - if: matrix.configuration == 'Release' - uses: actions/upload-artifact@v4 - with: - name: Colors.Dev-${{ github.ref_name }}-${{ matrix.platform }} - path: release - - name: Create GitHub Release - if: startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release' uses: softprops/action-gh-release@v2 with: files: release/*