Skip to content
Merged

OS2 #28

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
133 changes: 133 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions NUnitTests/NUnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -11,10 +11,10 @@
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />

<PackageReference Include="OneScript" Version="2.0.0-rc.7" />
<PackageReference Include="OneScript.StandardLibrary" Version="2.0.0-rc.7" />
<PackageReference Include="OneScript.CoreLib" Version="2.0.0-rc.7" />
<PackageReference Include="OneScript.Hosting" Version="2.0.0-rc.7" />
<PackageReference Include="OneScript" Version="2.0.1" />
<PackageReference Include="OneScript.StandardLibrary" Version="2.0.1" />
<PackageReference Include="OneScript.CoreLib" Version="2.0.1" />
<PackageReference Include="OneScript.Hosting" Version="2.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion TestApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions TestApp/TestApp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>v8unpack</RootNamespace>
<PackageVersion>2.0.0</PackageVersion>
<AssemblyVersion>2.0.0</AssemblyVersion>
Expand All @@ -10,9 +10,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OneScript" Version="2.0.0-rc.7" />
<PackageReference Include="OneScript.CoreLib" Version="2.0.0-rc.7" />
<PackageReference Include="OneScript.Hosting" Version="2.0.0-rc.7" />
<PackageReference Include="OneScript" Version="2.0.1" />
<PackageReference Include="OneScript.CoreLib" Version="2.0.1" />
<PackageReference Include="OneScript.Hosting" Version="2.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 0 additions & 7 deletions TestApp/packages.config

This file was deleted.

28 changes: 13 additions & 15 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -94,4 +92,4 @@ artifacts:
- path: oslib\*.ospx
name: v8unpack
- path: oslib\Components\dotnet\*.dll
name: components
name: components
File renamed without changes.
2 changes: 1 addition & 1 deletion oslib/packagedef
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Описание
.Имя("v8unpack")
.Версия("1.0.8")
.Версия("1.0.9")
.Автор("Sergey Batanov")
.АдресАвтора("sergey.batanov@dmpas.ru")
.Описание("Компонента работы с файлами формата 8")
Expand Down
8 changes: 4 additions & 4 deletions v8unpack/v8unpack.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>v8unpack</RootNamespace>
<PackageVersion>2.0.0</PackageVersion>
<AssemblyVersion>2.0.0</AssemblyVersion>
Expand All @@ -11,9 +11,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OneScript" Version="2.0.0-rc.7" />
<PackageReference Include="OneScript.CoreLib" Version="2.0.0-rc.7" />
<PackageReference Include="OneScript.StandardLibrary" Version="2.0.0-rc.7" />
<PackageReference Include="OneScript" Version="2.0.1" />
<PackageReference Include="OneScript.CoreLib" Version="2.0.1" />
<PackageReference Include="OneScript.StandardLibrary" Version="2.0.1" />
</ItemGroup>

</Project>
Loading