Create main.yml #28
Workflow file for this run
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: Automated Test Build | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: windows-2019 | |
env: | |
Solution_Name: libWindbot.sln | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
#- name: Cache nuget | |
# uses: actions/cache@v3 | |
# with: | |
# path: ~/.nuget/packages | |
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
# restore-keys: | | |
# ${{ runner.os }}-nuget- | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: gu | |
run: dir C:\Android\android-sdk\platforms | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
with: | |
packages: 'platforms;android-25' | |
- name: gugu | |
run: dir C:\Android\android-sdk\platforms | |
- name: Install Mono | |
run: | | |
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://download.mono-project.com/archive/5.12.0/windows-installer/mono-5.12.0-gtksharp-2.12.45-win32-0.msi ; exit 0" | |
msiexec /i mono-5.12.0-gtksharp-2.12.45-win32-0.msi /quiet /norestart | |
- name: Reg path | |
run: | | |
$dir = Get-ChildItem -Path "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances" -Directory | |
$vsRandomID = $dir[0].Name | |
reg add HKCU\Software\Xamarin\VisualStudio\16.0_${vsRandomID}\Android /v JavaSdkDirectory /d "C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot" /f | |
reg add HKCU\Software\Xamarin\VisualStudio\16.0_${vsRandomID}\Android /v AndroidSdkDirectory /d "C:\Android\android-sdk" /f | |
reg add HKCU\Software\Xamarin\VisualStudio\16.0_${vsRandomID}\Android /v AndroidNdkDirectory /d "C:\hostedtoolcache\windows\ndk\r15c" /f | |
xcopy /e /y "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0" "C:\Users\runneradmin\.nuget\packages\embeddinator-4000\0.4.0\external\Xamarin.Android\lib\xbuild-frameworks\MonoAndroid\v1.0\" | |
- name: Install NDK r15c | |
uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: r15c | |
- name: Setup MSBuild.exe | |
uses: microsoft/setup-msbuild@v1 | |
- name: Restore the application | |
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=Release | |
- name: Fixed E4K | |
run: | | |
Invoke-WebRequest -Uri "https://github.com/mercury233/libWindbot/files/14755286/tools.zip" -OutFile "fixed-e4k-tools.zip" | |
Expand-Archive -Path "fixed-e4k-tools.zip" -DestinationPath "C:\Users\runneradmin\.nuget\packages\embeddinator-4000\0.4.0\" -Force | |
- name: Build! | |
run: msbuild $env:Solution_Name /t:Build /p:Configuration=Release | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: output\libWindbot.aar | |
- name: GitHub Release | |
#if: github.event_name == 'push' | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "latest" | |
prerelease: true | |
title: "Development Build" | |
files: | | |
output/libWindbot.aar |