mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
ci: support multiple tracks
This commit is contained in:
parent
5824d837bc
commit
3062d2d930
1 changed files with 28 additions and 11 deletions
37
.github/workflows/main.yml
vendored
37
.github/workflows/main.yml
vendored
|
|
@ -49,27 +49,44 @@ jobs:
|
||||||
name: dalamud-artifact
|
name: dalamud-artifact
|
||||||
path: .\scratch
|
path: .\scratch
|
||||||
|
|
||||||
|
- name: Extract branch name
|
||||||
|
shell: bash
|
||||||
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
||||||
|
id: extract_branch
|
||||||
|
|
||||||
- name: Generate dalamud-distrib version file
|
- name: Generate dalamud-distrib version file
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
GH_BRANCH: ${{ steps.extract_branch.outputs.branch }}
|
||||||
run: |
|
run: |
|
||||||
Compress-Archive .\scratch\* .\canary.zip # Recreate the release zip
|
Compress-Archive .\scratch\* .\canary.zip # Recreate the release zip
|
||||||
|
|
||||||
|
$branchName = $env:GH_BRANCH
|
||||||
|
|
||||||
|
if ($branchName -eq "master") {
|
||||||
|
$branchName = "stg"
|
||||||
|
}
|
||||||
|
|
||||||
$dllBytes = [System.IO.File]::ReadAllBytes("$(Get-Location)\scratch\Dalamud.dll")
|
$dllBytes = [System.IO.File]::ReadAllBytes("$(Get-Location)\scratch\Dalamud.dll")
|
||||||
$assembly = [System.Reflection.Assembly]::Load($dllBytes)
|
$assembly = [System.Reflection.Assembly]::Load($dllBytes)
|
||||||
$newVersion = $assembly.GetCustomAttributes([System.Reflection.AssemblyMetadataAttribute]) | Where { $_.GetType() -eq [System.Reflection.AssemblyMetadataAttribute] } | Select -First 1 | Select -ExpandProperty "Value"
|
$newVersion = $assembly.GetCustomAttributes([System.Reflection.AssemblyMetadataAttribute]) | Where { $_.GetType() -eq [System.Reflection.AssemblyMetadataAttribute] } | Select -First 1 | Select -ExpandProperty "Value"
|
||||||
Remove-Item -Force -Recurse .\scratch
|
Remove-Item -Force -Recurse .\scratch
|
||||||
|
|
||||||
$versionData = Get-Content .\stg\version | ConvertFrom-Json
|
if (Test-Path -Path $branchName) {
|
||||||
$oldVersion = $versionData.AssemblyVersion
|
$versionData = Get-Content ".\${branchName}\version" | ConvertFrom-Json
|
||||||
if ($oldVersion -eq $newVersion) {
|
$oldVersion = $versionData.AssemblyVersion
|
||||||
Remove-Item .\canary.zip
|
if ($oldVersion -eq $newVersion) {
|
||||||
} else {
|
Remove-Item .\canary.zip
|
||||||
Move-Item -Force .\canary.zip .\stg\latest.zip
|
} else {
|
||||||
$versionData.AssemblyVersion = $newVersion
|
Move-Item -Force ".\canary.zip" ".\${branchName}\latest.zip"
|
||||||
$versionData | ConvertTo-Json -Compress | Out-File .\stg\version
|
$versionData.AssemblyVersion = $newVersion
|
||||||
}
|
$versionData | ConvertTo-Json -Compress | Out-File ".\${branchName}\version"
|
||||||
|
}
|
||||||
|
|
||||||
echo "DVER=${newVersion}" >> $Env:GITHUB_ENV
|
echo "DVER=${newVersion}" >> $Env:GITHUB_ENV
|
||||||
|
} else {
|
||||||
|
Write-Host "Deployment folder doesn't exist. Not doing anything."
|
||||||
|
}
|
||||||
|
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue