diff --git a/.github/workflows/build_nupkg.yml b/.github/workflows/build_and_test.yml similarity index 64% rename from .github/workflows/build_nupkg.yml rename to .github/workflows/build_and_test.yml index d434e42..9f55196 100644 --- a/.github/workflows/build_nupkg.yml +++ b/.github/workflows/build_and_test.yml @@ -1,4 +1,4 @@ -name: Nuget Pack +name: Build and Test on: push: @@ -18,27 +18,26 @@ jobs: with: dotnet-version: 9.0.x - - name: Restore dependencies - run: dotnet restore + - name: Run tests + run: dotnet test - - name: Pack - run: dotnet pack + - name: Run publish script + run: ./publish-nix.sh -d - - name: Upload NDecrypt Core package + - name: Upload package uses: actions/upload-artifact@v4 with: - name: 'NDecrypt Core Package' - path: 'NDecrypt.Core/bin/Release/*.nupkg' + name: 'Nuget Package' + path: '*.nupkg' - - name: Upload NDecrypt Core to rolling + - name: Upload to rolling uses: ncipollo/release-action@v1.14.0 with: allowUpdates: True - artifacts: 'NDecrypt.Core/bin/Release/*.nupkg' + artifacts: "*.nupkg,*.zip" body: 'Last built commit: ${{ github.sha }}' name: 'Rolling Release' prerelease: True replacesArtifacts: True tag: "rolling" updateOnlyUnreleased: True - diff --git a/.github/workflows/build_program.yml b/.github/workflows/build_program.yml deleted file mode 100644 index a6af6a7..0000000 --- a/.github/workflows/build_program.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Build Program - -on: - push: - branches: [ "master" ] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - project: [NDecrypt] - runtime: [win-x86, win-x64, win-arm64, linux-x64, linux-arm64, osx-x64] - framework: [net9.0] #[net20, net35, net40, net452, net472, net48, netcoreapp3.1, net5.0, net6.0, net7.0, net8.0, net9.0] - conf: [Debug] #[Release, Debug] - - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 9.0.x - - - name: Restore dependencies - run: dotnet restore - - - name: Build - run: dotnet publish ${{ matrix.project }}/${{ matrix.project }}.csproj -f ${{ matrix.framework }} -r ${{ matrix.runtime }} -c ${{ matrix.conf == 'Release' && 'Release -p:DebugType=None -p:DebugSymbols=false' || 'Debug'}} --self-contained true --version-suffix ${{ github.sha }} ${{ (startsWith(matrix.framework, 'net5') || startsWith(matrix.framework, 'net6') || startsWith(matrix.framework, 'net7') || startsWith(matrix.framework, 'net8') || startsWith(matrix.framework, 'net9')) && '-p:PublishSingleFile=true' || ''}} - - - name: Archive build - run: | - cd ${{ matrix.project }}/bin/${{ matrix.conf }}/${{ matrix.framework }}/${{ matrix.runtime }}/publish/ - zip -r ${{ github.workspace }}/${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }}.zip ./ - - - name: Upload build - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }} - path: ${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }}.zip - - - name: Upload to rolling - uses: ncipollo/release-action@v1.14.0 - with: - allowUpdates: True - artifacts: ${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }}.zip - body: 'Last built commit: ${{ github.sha }}' - name: 'Rolling Release' - prerelease: True - replacesArtifacts: True - tag: "rolling" - updateOnlyUnreleased: True diff --git a/README.md b/README.md index 5e71d59..b1c96fc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # NDecrypt -[![Build status](https://ci.appveyor.com/api/projects/status/cc1n298syn6r50mq?svg=true)](https://ci.appveyor.com/project/mnadareski/ndecrypt) -[![Program Build](https://github.com/SabreTools/NDecrypt/actions/workflows/build_program.yml/badge.svg)](https://github.com/SabreTools/NDecrypt/actions/workflows/build_program.yml) +[![Build and Test](https://github.com/SabreTools/NDecrypt/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/SabreTools/NDecrypt/actions/workflows/build_and_test.yml) A simple tool for simple people. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 8ec42fc..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,26 +0,0 @@ -# version format -version: 0.2.5-{build} - -# pull request template -pull_requests: - do_not_increment_build_number: true - -# vm template -image: Visual Studio 2022 - -# install dependencies -install: -- cd %APPVEYOR_BUILD_FOLDER% -- git submodule update --init --recursive - -# build step -build_script: - - dotnet build - -# success/failure tracking -on_success: - - ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1 - - ps: ./send.ps1 success $env:WEBHOOK_URL -on_failure: - - ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1 - - ps: ./send.ps1 failure $env:WEBHOOK_URL \ No newline at end of file diff --git a/publish-nix.sh b/publish-nix.sh index 02b81a4..de1e487 100644 --- a/publish-nix.sh +++ b/publish-nix.sh @@ -10,13 +10,17 @@ # Optional parameters USE_ALL=false +INCLUDE_DEBUG=false NO_BUILD=false NO_ARCHIVE=false -while getopts "uba" OPTION; do +while getopts "udba" OPTION; do case $OPTION in u) USE_ALL=true ;; + d) + INCLUDE_DEBUG=true + ;; b) NO_BUILD=true ;; @@ -39,6 +43,7 @@ COMMIT=$(git log --pretty=%H -1) # Output the selected options echo "Selected Options:" echo " Use all frameworks (-u) $USE_ALL" +echo " Include debug builds (-d) $INCLUDE_DEBUG" echo " No build (-b) $NO_BUILD" echo " No archive (-a) $NO_ARCHIVE" echo " " @@ -91,14 +96,14 @@ if [ $NO_BUILD = false ]; then # Only .NET 5 and above can publish to a single file if [[ $(echo ${SINGLE_FILE_CAPABLE[@]} | fgrep -w $FRAMEWORK) ]]; then - # Only include Debug if building all - if [ $USE_ALL = true ]; then + # Only include Debug if set + if [ $INCLUDE_DEBUG = true ]; then dotnet publish NDecrypt/NDecrypt.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true fi dotnet publish NDecrypt/NDecrypt.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false else - # Only include Debug if building all - if [ $USE_ALL = true ]; then + # Only include Debug if set + if [ $INCLUDE_DEBUG = true ]; then dotnet publish NDecrypt/NDecrypt.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT fi dotnet publish NDecrypt/NDecrypt.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false @@ -131,8 +136,8 @@ if [ $NO_ARCHIVE = false ]; then fi fi - # Only include Debug if building all - if [ $USE_ALL = true ]; then + # Only include Debug if set + if [ $INCLUDE_DEBUG = true ]; then cd $BUILD_FOLDER/NDecrypt/bin/Debug/${FRAMEWORK}/${RUNTIME}/publish/ zip -r $BUILD_FOLDER/NDecrypt_${FRAMEWORK}_${RUNTIME}_debug.zip . fi diff --git a/publish-win.ps1 b/publish-win.ps1 index 166d194..e9a90a4 100644 --- a/publish-win.ps1 +++ b/publish-win.ps1 @@ -12,6 +12,10 @@ param( [Alias("UseAll")] [switch]$USE_ALL, + [Parameter(Mandatory = $false)] + [Alias("IncludeDebug")] + [switch]$INCLUDE_DEBUG, + [Parameter(Mandatory = $false)] [Alias("NoBuild")] [switch]$NO_BUILD, @@ -30,6 +34,7 @@ $COMMIT = git log --pretty=format:"%H" -1 # Output the selected options Write-Host "Selected Options:" Write-Host " Use all frameworks (-UseAll) $USE_ALL" +Write-Host " Include debug builds (-IncludeDebug) $INCLUDE_DEBUG" Write-Host " No build (-NoBuild) $NO_BUILD" Write-Host " No archive (-NoArchive) $NO_ARCHIVE" Write-Host " " @@ -78,15 +83,15 @@ if (!$NO_BUILD.IsPresent) { # Only .NET 5 and above can publish to a single file if ($SINGLE_FILE_CAPABLE -contains $FRAMEWORK) { - # Only include Debug if building all - if ($USE_ALL.IsPresent) { + # Only include Debug if set + if ($INCLUDE_DEBUG.IsPresent) { dotnet publish NDecrypt\NDecrypt.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true } dotnet publish NDecrypt\NDecrypt.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false } else { - # Only include Debug if building all - if ($USE_ALL.IsPresent) { + # Only include Debug if set + if ($INCLUDE_DEBUG.IsPresent) { dotnet publish NDecrypt\NDecrypt.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT } dotnet publish NDecrypt\NDecrypt.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false @@ -115,8 +120,8 @@ if (!$NO_ARCHIVE.IsPresent) { continue } - # Only include Debug if building all - if ($USE_ALL.IsPresent) { + # Only include Debug if set + if ($INCLUDE_DEBUG.IsPresent) { Set-Location -Path $BUILD_FOLDER\NDecrypt\bin\Debug\${FRAMEWORK}\${RUNTIME}\publish\ 7z a -tzip $BUILD_FOLDER\NDecrypt_${FRAMEWORK}_${RUNTIME}_debug.zip * }