Sync to CN 7.01 #23
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 artifact | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
paths: | |
- '.github/workflows/build-artifact.yml' | |
- 'AddonExample/**' | |
- 'HtmlRenderer/**' | |
- 'Overlay*/**' | |
- 'tools/fetch_deps.ps1' | |
- 'DEPS.json' | |
- 'OverlayPlugin.sln' | |
- 'build.bat' | |
- 'build.ps1' | |
workflow_dispatch: | |
jobs: | |
msbuild: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7' | |
- name: Set artifact name | |
shell: bash | |
run: | | |
sha=$(echo ${{ github.sha }} | cut -c 1-8) | |
echo "artifact_sha=$sha" >> $GITHUB_ENV | |
- name: Check dependencies cache | |
id: cache-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
./Thirdparty | |
./OverlayPlugin.Core/Thirdparty | |
key: ${{ runner.os }}-overlayplugin-${{ hashFiles('./tools/fetch_deps.ps1', './DEPS.json', './tools/StripFFXIVClientStructs/StripFFXIVClientStructs/StripFFXIVClientStructs.cs') }} | |
restore-keys: | | |
${{ runner.os }}-overlayplugin- | |
# Fetch dependencies only if cache-hit is false | |
- name: Fetch dependencies | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
shell: pwsh | |
run: | | |
.\tools\fetch_deps.ps1 | |
- name: Set up msbuild | |
uses: microsoft/[email protected] | |
- name: Add Custom Problem Matcher | |
run: | | |
echo "::add-matcher::.github/matchers/${{ github.job }}.json" | |
- name: Run Build | |
run: .\build.bat -ci | |
shell: cmd | |
- name: Determine Version | |
shell: pwsh | |
run: | | |
[xml]$csprojcontents = Get-Content -Path "Directory.Build.props"; | |
$version = $csprojcontents.Project.PropertyGroup.AssemblyVersion; | |
$version = ($version | Out-String).Trim() | |
echo "version=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
# Expected "OverlayPlugin" as top level item of .zip | |
- name: Create Intermediate Directory | |
shell: bash | |
run: | | |
cd out/Release | |
mkdir tmp/ | |
mv OverlayPlugin/ tmp/ | |
mv tmp/ OverlayPlugin/ | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: OverlayPlugin-${{ env.version }}-${{ env.artifact_sha }} | |
path: out/Release/OverlayPlugin/ | |
retention-days: 30 |