Skip to content

API 12

API 12 #60

Workflow file for this run

name: Debug Build and Test
on: [push, pull_request]
jobs:
build-debug:
runs-on: windows-2022
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
steps:
- name: Checkout and Initialise
uses: actions/checkout@v3
# Get Date and time
- name: Set Date Output
id: date
shell: pwsh
run: |
echo "date-month=$(Get-Date -Format 'yyyy-MM')" >> $GITHUB_ENV
echo "date-time=$(Get-Date -Format 'yyyy-MM-dd_HH-mm')" >> $GITHUB_ENV
# Get Dalamud version from project file
- name: Extract Project Dalamud Version
id: project-dalamud-version
shell: pwsh
run: |
[xml]$xml = Get-Content "./DelvCD/DelvCD.csproj"
$dalamudVersion = $xml.Project.PropertyGroup.DalamudCIDist
echo "dalamud-version=$dalamudVersion" >> $GITHUB_ENV
# Set Dalamud Version Normalised URL Env
- name: Set Dalamud Version Normalised URL Env
id: dalamud-norm-url
shell: pwsh
run: |
$url = if ('${{ env.dalamud-version }}' -eq 'release') { '' } else { '${{ env.dalamud-version }}' }
echo "url=$url" >> $GITHUB_ENV
# Request the version information from Dalamud
- name: Get Dalamud Version JSON
id: request-dalamud-version
shell: pwsh
run: |
$DALAMUD_VER_INFO = Invoke-RestMethod -Uri https://goatcorp.github.io/dalamud-distrib/${{ env.url }}/version
echo $DALAMUD_VER_INFO
$DALAMUD_VER_INFO | ConvertTo-Json | Set-Content dalamud-version.json
# Cache the nuget packages and Dalamud build
- name: Cache Dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: |
./dalamud
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/*.csproj') }}-${{ hashFiles('dalamud-version.json') }}
# If the cache didn't hit, download and extract Dalamud
- name: Setup Dalamud
if: steps.cache-dependencies.outputs.cache-hit != 'true'
shell: pwsh
run: |
mkdir ./dalamud
Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/${{ env.url }}/latest.zip -OutFile ./dalamud/latest.zip
Expand-Archive -Path ./dalamud/latest.zip ./dalamud
# Restore, Build and Test
- name: Restore project dependencies
run: dotnet restore --verbosity normal
- name: Build Debug
run: dotnet build --no-restore --verbosity normal --configuration Debug
- name: Test Debug
run: dotnet test --no-build --verbosity normal --configuration Debug
# Upload build artifact
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: DelvCD-debug-${{ github.sha }}
path: |
DelvCD/bin/x64/Debug
!DelvCD/bin/x64/Debug/DelvCD