Skip to content

Commit

Permalink
github and appveyor CI updates for artifact upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jhmgoossens committed Nov 18, 2023
1 parent 28c9dec commit b206fe7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- name: Setup environment
run: |
echo "builddate=$(Get-Date -format r)" >> $env:GITHUB_ENV
echo "release_name=Sonnet-$("${{ github.ref_name }}".Replace("/","-"))-CI" >> $env:GITHUB_ENV
- name: Setup msbuild
uses: microsoft/[email protected]
Expand Down Expand Up @@ -49,15 +50,10 @@ jobs:
- name: Prepare for build
shell: pwsh
run: |
echo Built on: ${{ env.builddate }} > Sonnet\BUILD-INFO.txt
echo Version: 1.4.0.${{ github.run_number }} >> Sonnet\BUILD-INFO.txt
echo Ref: ${{ github.ref }} >> Sonnet\BUILD-INFO.txt
echo Ref name: ${{ github.ref_name }} >> Sonnet\BUILD-INFO.txt
echo Commit: ${{ github.sha }} >> Sonnet\BUILD-INFO.txt
Sonnet\build-third-party-license.bat
(Get-Content Sonnet\src\Sonnet\AssemblyInfo.cs).Replace('2.0.0.9999','2.0.0.${{ github.run_number }}') | Set-Content Sonnet\src\Sonnet\AssemblyInfo.cs
(Get-Content Sonnet\src\SonnetWrapper\AssemblyInfo.h).Replace('2.0.0.9999','2.0.0.${{ github.run_number }}').Replace('2,0,0,9999','2,0,0,${{ github.run_number }}') | Set-Content Sonnet\src\SonnetWrapper\AssemblyInfo.h
7z --% a -tzip -r -x!.git "Sonnet-${{ github.ref_name }}-CI-src.zip" .\*
7z --% a -tzip -r -x!.git "${{ env.release_name }}-src.zip" .\*
nuget restore Sonnet\MSVisualStudio\v17\Sonnet.sln
- name: Build
Expand All @@ -83,8 +79,8 @@ jobs:
cd Sonnet\MSVisualStudio\v17\SonnetTest\bin\x64\Release\net6.0\
.\SonnetTest.exe
- name: Create asset package
if: ${{ github.ref_name == 'master' }}
- name: Create artifact package for master or stable
if: ${{ ( github.ref_name == 'master' ) || startsWith(github.ref_name, 'stable/' ) }}
shell: cmd
run: |
mkdir package\x64\net6.0
Expand All @@ -107,8 +103,22 @@ jobs:
copy Sonnet\THIRD-PARTY-LICENSE.txt package\.
copy Sonnet\examples\Example5.cs package\.
cd package
7z a -tzip -r "..\Sonnet-${{ github.ref_name }}-CI-bin.zip" *
7z a -tzip -r "..\${{ env.release_name }}-bin.zip" .\*
cd ..
- name: Upload src artifact
if: ${{ ( github.ref_name == 'master' ) || startsWith(github.ref_name, 'stable/' ) }}
uses: actions/upload-artifact@v3
with:
name: Sonnet Sources
path: ${{ env.release_name }}-src.zip

- name: Upload bin artifact
if: ${{ ( github.ref_name == 'master' ) || startsWith(github.ref_name, 'stable/' ) }}
uses: actions/upload-artifact@v3
with:
name: Sonnet
path: ${{ env.release_name }}-bin.zip

- name: Update latest release
if: ${{ github.ref_name == 'master' }}
Expand All @@ -126,9 +136,9 @@ jobs:
The Sonnet latest builds use the latest code in the [master branch of Cbc](https://github.com/coin-or/cbc) and its dependencies.
The Sonnet latest builds are created automatically at every successful build following a commit to the master branch.
Use the Sonnet-${{ github.ref_name }}-CI-src.zip to get all sources of Sonnet, Cbc and dependencies.
Use the S${{ env.release_name }}-src.zip to get all sources of Sonnet, Cbc and dependencies.
Do not use the 'Source code' assets because it only contains the sources of Sonnet.
token: ${{ secrets.GITHUB_TOKEN }}
files: |
Sonnet-${{ github.ref_name }}-CI-src.zip
Sonnet-${{ github.ref_name }}-CI-bin.zip
${{ env.release_name }}-src.zip
${{ env.release_name }}-bin.zip
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Sonnet is a modelling API and wrapper for COIN-OR mixed integer linear programmi

Sonnet uses a wrapper to make the COIN-OR C++ classes available in .NET.
COIN-OR projects included in the wrapper:
[BuildTools](https://github.com/coin-or-tools/BuildTools),
[Cbc](https://github.com/coin-or/Cbc),
[Cgl](https://github.com/coin-or/Cgl),
[Clp](https://github.com/coin-or/Clp),
[CoinUtils](https://github.com/coin-or/CoinUtils)
[Osi](https://github.com/coin-or/Osi).

The Sonnet API allows for code like this:
Expand Down Expand Up @@ -64,7 +64,6 @@ See https://github.com/coin-or/Cbc#source how to get the relevant sources.
The Sonnet solution expects the COIN-OR source code to be in the same root folder.
The folder structure should look like this:

├─ [BuildTools](https://github.com/coin-or-tools/BuildTools)
├─ [Cbc](https://github.com/coin-or/Cbc)
├─ [Cgl](https://github.com/coin-or/Cgl)
├─ [Clp](https://github.com/coin-or/Clp)
Expand Down Expand Up @@ -102,7 +101,7 @@ Several pthread for Windows libraries are available. Sonnet was succesfully test
To build Sonnet with pthread, all necessary project settings are available in the respective ReleaseParallel configurations of libCbc, libCbcSolver and SonnetWrapper:
- Solution: Use the ReleaseParallel configuration.
- Define: CBC_THREAD is defined by the projects
- Include: "pthreads" include folder is expected at one level above the Sonnet root folder, so _not_ besides BuildTools, etc., but one level above.
- Include: "pthreads" include folder is expected at one level above the Sonnet root folder, so _not_ besides Cbc, etc., but one level above.
- Linker: SonnetWrapper links to pthread_static_lib.lib that is expected in the lib\Win32 or lib\x64 folder at the root of Sonnet folder. You have to build this first, below.

Start by cloning the pthread repo, and opening the solution in VS2019. You can decide to build the pthread dll or the pthread static lib.
Expand Down
9 changes: 3 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ before_build:
- echo RELEASE_NAME "%RELEASE_NAME%"
- echo RELEASE_TYPE "%RELEASE_TYPE%"
- echo Creating %RELEASE_NAME%-src.zip artefact from projects folder
- echo Built on %date% %time% > BUILD-INFO.txt
- echo Version 1.3.1.%APPVEYOR_BUILD_NUMBER% >> BUILD-INFO.txt
- echo Repo %APPVEYOR_REPO_NAME% >> BUILD-INFO.txt
- echo Ref name %APPVEYOR_REPO_BRANCH% >> BUILD-INFO.txt
- echo Commit %APPVEYOR_REPO_COMMIT% >> BUILD-INFO.txt
- call build-third-party-license.bat
- 7z a -tzip -r -x!.git "c:\projects\sonnet\%RELEASE_NAME%-src.zip" c:\projects\*
- nuget restore MSVisualStudio\v17\Sonnet.sln
Expand Down Expand Up @@ -170,7 +165,9 @@ after_test:
- copy README.md package\.
- copy THIRD-PARTY-LICENSE.txt package\.
- copy examples\Example5.cs package\.
- 7z a -tzip -r "c:\projects\sonnet\%RELEASE_NAME%-bin.zip" c:\projects\sonnet\package\*
- cd package
- 7z a -tzip -r "c:\projects\sonnet\%RELEASE_NAME%-bin.zip" *
- cd ..
- if not "%sonar_token%"=="" ( SonarScanner.MSBuild.exe end /d:"sonar.login=%sonar_token%" )

artifacts:
Expand Down

0 comments on commit b206fe7

Please sign in to comment.