diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ec31167 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,133 @@ +name: CI + +on: + push: + branches: [master, develop] + tags: ['v*'] + pull_request: + branches: [master, develop] + workflow_dispatch: + +permissions: + contents: write + +env: + MAIN_PROJECT: v8unpack + CONFIGURATION: Release + OS1_LINK: https://oscript.io/downloads/1_9_4/x64/OneScript-1.9.4-x64.zip + OS2_LINK: https://oscript.io/downloads/latest/OneScript-2.1.0-fdd-x64.zip + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup UTF-8 locale + shell: pwsh + run: | + reg add "HKLM\Software\Microsoft\Command Processor" /v Autorun /t REG_SZ /d "chcp 65001>nul" /f + Set-WinSystemLocale -SystemLocale ru-RU -ErrorAction SilentlyContinue + chcp 65001 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Install OneScript 2.x + shell: cmd + run: | + mkdir os2 + cd os2 + curl -L -o fdd.zip %OS2_LINK% + 7z x fdd.zip -y > NUL + call bin\oscript.bat -version + call bin\oscript.bat lib\opm\src\cmd\opm.os install opm + call bin\oscript.bat lib\opm\src\cmd\opm.os list + cd .. + + - name: Install OneScript 1.x + shell: cmd + run: | + mkdir os1 + cd os1 + curl -L -o os1.zip %OS1_LINK% + 7z x os1.zip -y > NUL + bin\oscript.exe -version + bin\oscript.exe lib\opm\src\cmd\opm.os install opm + bin\oscript.exe lib\opm\src\cmd\opm.os list + cd .. + + - name: Download OneScriptDocumenter + shell: cmd + run: | + curl -L -o OneScriptDocumenter.zip https://github.com/dmpas/OneScriptDocumenter/releases/download/1.0.13/documenter.zip + 7z x OneScriptDocumenter.zip -y > NUL + + - name: Restore + run: dotnet restore oscript-v8unpack.sln + + - name: Build + run: dotnet build oscript-v8unpack.sln -c ${{ env.CONFIGURATION }} --no-restore + + - name: Test (NUnit) + run: dotnet test NUnitTests/NUnitTests.csproj -c ${{ env.CONFIGURATION }} --no-build --verbosity normal + + - name: Package + shell: cmd + run: | + del %MAIN_PROJECT%\bin\%CONFIGURATION%\net8.0\*.pdb + + mkdir oslib\Components\dotnet + + OneScriptDocumenter.exe json oslib\Components\dotnet\syntaxHelp.json %MAIN_PROJECT%\bin\%CONFIGURATION%\net8.0\1script_%MAIN_PROJECT%.dll + + del %MAIN_PROJECT%\bin\%CONFIGURATION%\ScriptEngine*.* %MAIN_PROJECT%\bin\%CONFIGURATION%\net8.0\NewtonSoft*.* %MAIN_PROJECT%\bin\%CONFIGURATION%\net8.0\DotNetZip*.* + + xcopy %MAIN_PROJECT%\bin\%CONFIGURATION%\net8.0\* oslib\Components\dotnet\ /Y + xcopy README.md oslib\ /Y + + cd oslib + call ..\os2\bin\oscript.bat ..\os2\lib\opm\src\cmd\opm.os build . + cd .. + + - name: Test (OneScript 2.x) + shell: cmd + run: | + cd oslib + for %%X in (*.ospx) do (call ..\os2\bin\oscript.bat ..\os2\lib\opm\src\cmd\opm.os install -f %%X) + cd .. + set OSLIB_LOADER_TRACE=1 + call os2\bin\oscript.bat testcomponent.os + + - name: Test (OneScript 1.x) + shell: cmd + run: | + cd oslib + for %%X in (*.ospx) do (..\os1\bin\oscript.exe ..\os1\lib\opm\src\cmd\opm.os install -f %%X) + cd .. + set OSLIB_LOADER_TRACE=1 + os1\bin\oscript.exe testcomponent.os + + - name: Upload ospx artifact + uses: actions/upload-artifact@v7 + with: + name: v8unpack + path: oslib/*.ospx + archive: false + + - name: Upload components artifact + uses: actions/upload-artifact@v7 + with: + name: components + path: oslib/Components/dotnet/*.dll + + - name: Publish GitHub Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v2 + with: + files: oslib/*.ospx + generate_release_notes: true diff --git a/NUnitTests/NUnitTests.csproj b/NUnitTests/NUnitTests.csproj index fd1f0f5..7c7de39 100644 --- a/NUnitTests/NUnitTests.csproj +++ b/NUnitTests/NUnitTests.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 false @@ -11,10 +11,10 @@ - - - - + + + + diff --git a/TestApp/Program.cs b/TestApp/Program.cs index 00d46f0..4776edb 100644 --- a/TestApp/Program.cs +++ b/TestApp/Program.cs @@ -7,7 +7,6 @@ This Source Code Form is subject to the terms of the using System; using OneScript.StandardLibrary; using ScriptEngine.HostedScript; -using ScriptEngine.HostedScript.Library; using ScriptEngine.Hosting; namespace TestApp diff --git a/TestApp/TestApp.csproj b/TestApp/TestApp.csproj index 661e4fd..7488551 100644 --- a/TestApp/TestApp.csproj +++ b/TestApp/TestApp.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 v8unpack 2.0.0 2.0.0 @@ -10,9 +10,9 @@ - - - + + + diff --git a/TestApp/packages.config b/TestApp/packages.config deleted file mode 100644 index b556ff6..0000000 --- a/TestApp/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 9dda0bf..0e4eff4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,9 @@ -version: 1.0.8-{build} +version: 1.0.9-{build} image: Visual Studio 2022 environment: main_project: v8unpack + os1_link: https://oscript.io/downloads/1_9_4/x64/OneScript-1.9.4-x64.zip + os2_link: https://oscript.io/downloads/latest/OneScript-2.1.0-fdd-x64.zip before_build: - ps: nuget restore init: @@ -15,7 +17,7 @@ install: cd os2 - appveyor DownloadFile https://oscript.io/downloads/preview/OneScript-2.0.0-rc.10-fdd-x64.zip -FileName fdd.zip + appveyor DownloadFile %os2_link% -FileName fdd.zip 7z x fdd.zip > NUL @@ -30,9 +32,9 @@ install: cd os1 - appveyor DownloadFile https://oscript.io/downloads/latest/zip -FileName latest.zip + appveyor DownloadFile %os1_link% -FileName os1.zip - 7z x latest.zip > NUL + 7z x os1.zip > NUL bin\oscript.exe -version @@ -50,7 +52,7 @@ build: verbosity: minimal configuration: Release test_script: -- cmd: nunit3-console NUnitTests\bin\%CONFIGURATION%\net6.0\NUnitTests.dll --result=myresults.xml;format=AppVeyor +- cmd: nunit3-console NUnitTests\bin\%CONFIGURATION%\net8.0\NUnitTests.dll --result=myresults.xml;format=AppVeyor - cmd: >- set OSLIB_LOADER_TRACE=1 @@ -64,21 +66,17 @@ test_script: after_build: - cmd: >- - del %main_project%\bin\%CONFIGURATION%\net6.0\*.pdb + del %main_project%\bin\%CONFIGURATION%\net8.0\*.pdb - mkdir oslib\Components - mkdir oslib\Components\dotnet - - mkdir oslib\Components\net4 - OneScriptDocumenter.exe json oslib\Components\dotnet\syntaxHelp.json %main_project%\bin\%CONFIGURATION%\net6.0\1script_%main_project%.dll + OneScriptDocumenter.exe json oslib\Components\dotnet\syntaxHelp.json %main_project%\bin\%CONFIGURATION%\net8.0\1script_%main_project%.dll - del %main_project%\bin\%CONFIGURATION%\ScriptEngine*.* %main_project%\bin\%CONFIGURATION%\net6.0\NewtonSoft*.* %main_project%\bin\%CONFIGURATION%\net6.0\DotNetZip*.* + del %main_project%\bin\%CONFIGURATION%\ScriptEngine*.* %main_project%\bin\%CONFIGURATION%\net8.0\NewtonSoft*.* %main_project%\bin\%CONFIGURATION%\net8.0\DotNetZip*.* - xcopy %main_project%\bin\%CONFIGURATION%\net6.0\* oslib\Components\dotnet\ + xcopy %main_project%\bin\%CONFIGURATION%\net8.0\* oslib\Components\dotnet\ - xcopy assets\1script_v8unpack.dll oslib\Components\net4\ + xcopy README.md oslib\ cd oslib @@ -94,4 +92,4 @@ artifacts: - path: oslib\*.ospx name: v8unpack - path: oslib\Components\dotnet\*.dll - name: components + name: components \ No newline at end of file diff --git a/assets/1script_v8unpack.dll b/oslib/Components/net4/1script_v8unpack.dll similarity index 100% rename from assets/1script_v8unpack.dll rename to oslib/Components/net4/1script_v8unpack.dll diff --git a/oslib/packagedef b/oslib/packagedef index b71e81d..60f9548 100644 --- a/oslib/packagedef +++ b/oslib/packagedef @@ -1,6 +1,6 @@ Описание .Имя("v8unpack") - .Версия("1.0.8") + .Версия("1.0.9") .Автор("Sergey Batanov") .АдресАвтора("sergey.batanov@dmpas.ru") .Описание("Компонента работы с файлами формата 8") diff --git a/v8unpack/v8unpack.csproj b/v8unpack/v8unpack.csproj index 7a83e70..2e6a079 100644 --- a/v8unpack/v8unpack.csproj +++ b/v8unpack/v8unpack.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 v8unpack 2.0.0 2.0.0 @@ -11,9 +11,9 @@ - - - + + + \ No newline at end of file