This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build_simhub_plugin | |
on: [push] | |
# see e.g. https://cgrotz.github.io/2020-08-24-esp32_ci_cd_part2/ | |
jobs: | |
######################################################################## | |
# Build SimHub plugin | |
######################################################################## | |
buildSimhubPlugin: | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v1 | |
- name: Setup NuGet | |
uses: NuGet/[email protected] | |
- name: Setup MS Build Systems | |
uses: microsoft/[email protected] | |
- uses: actions/cache@v3 | |
name: Restore Caches | |
id: cache | |
with: | |
path: | | |
innounp050.rar | |
SimHub.8.01.2.zip | |
key: SimHub.8.01.2 | |
- name: Download Requirements # Used to download the SimHub DLLs - only if not in cache. | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
aria2c -j1 -o innounp050.rar "https://sourceforge.net/projects/innounp/files/innounp/innounp%200.50/innounp050.rar/download" | |
aria2c -j1 -o SimHub.8.01.2.zip "https://github.com/SHWotever/SimHub/releases/download/9.1.22/SimHub.9.01.22.zip" | |
- name: Extract Requirements # Used to extract the SimHub DLLs | |
run: | | |
7z x innounp050.rar | |
7z x SimHub.8.01.2.zip | |
dir | |
mkdir "C:\Program Files (x86)\SimHub\" | |
${{ github.workspace }}\innounp.exe -v -x -b -e -d"C:\Program Files (x86)\SimHub\" SimHubSetup_9.1.22.exe | |
- name: List files in dir | |
run: | | |
ls "C:\Program Files (x86)\SimHub\" | |
#- name: List files in dir 2 | |
# run: | | |
# ls ${{ github.workspace }} | |
- name: Edit version | |
run: sed -i "s/\(AssemblyVersion(""\([0-9]\+\.\)\{3\}\)\([0-9]\+\)/\1${{github.run_number}}/" "SimHubPlugin/Properties/AssemblyInfo.cs" | |
- name: Restore Packages | |
run: nuget restore "SimHubPlugin/User.PluginSdkDemo.sln" | |
- name: Build solution | |
run: msbuild "SimHubPlugin/User.PluginSdkDemo.sln" -t:rebuild -property:Configuration=Release | |
# zip plugin binaries | |
- name: ZIP files | |
run: | | |
7z a ./SimHubPlugin/bin/SimHub_plugin.zip ./SimHubPlugin/bin/* | |
# Publish as build artifact | |
- name: Attach artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: simhub_plugin | |
path: | | |
./SimHubPlugin/bin/SimHub_plugin.zip |