Move CI workflow to Gitea actions
Some checks failed
Build Mod Package / build (push) Has been cancelled
Some checks failed
Build Mod Package / build (push) Has been cancelled
This commit is contained in:
@@ -7,30 +7,35 @@ on:
|
|||||||
- master
|
- master
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
release:
|
|
||||||
types:
|
|
||||||
- published
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on:
|
||||||
|
- windows
|
||||||
|
- win11
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Prepare workspace
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
- name: Setup .NET 8
|
if ($env:GITHUB_WORKSPACE -and (Test-Path -LiteralPath $env:GITHUB_WORKSPACE)) {
|
||||||
uses: actions/setup-dotnet@v4
|
Set-Location $env:GITHUB_WORKSPACE
|
||||||
with:
|
}
|
||||||
dotnet-version: "8.0.x"
|
|
||||||
|
if (-not (Test-Path -LiteralPath "Mods\\DnD55eRussian\\Localization\\Russian\\russian.xml")) {
|
||||||
|
throw "Repository sources are not available in the runner workspace."
|
||||||
|
}
|
||||||
|
|
||||||
|
New-Item -ItemType Directory -Path ".tools\\lslib" -Force | Out-Null
|
||||||
|
New-Item -ItemType Directory -Path "build" -Force | Out-Null
|
||||||
|
|
||||||
- name: Download latest LSLib release
|
- name: Download latest LSLib release
|
||||||
shell: pwsh
|
|
||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/Norbyte/lslib/releases/latest"
|
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/Norbyte/lslib/releases/latest"
|
||||||
@@ -40,13 +45,10 @@ jobs:
|
|||||||
throw "Could not find a downloadable LSLib zip asset in the latest release."
|
throw "Could not find a downloadable LSLib zip asset in the latest release."
|
||||||
}
|
}
|
||||||
|
|
||||||
New-Item -ItemType Directory -Path ".tools/lslib" -Force | Out-Null
|
|
||||||
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile ".tools/lslib/lslib.zip"
|
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile ".tools/lslib/lslib.zip"
|
||||||
Expand-Archive -LiteralPath ".tools/lslib/lslib.zip" -DestinationPath ".tools/lslib" -Force
|
Expand-Archive -LiteralPath ".tools/lslib/lslib.zip" -DestinationPath ".tools/lslib" -Force
|
||||||
|
|
||||||
- name: Resolve Divine executable
|
- name: Resolve Divine executable
|
||||||
id: divine
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
$divine = Get-ChildItem -Path ".tools/lslib" -Recurse -File |
|
$divine = Get-ChildItem -Path ".tools/lslib" -Recurse -File |
|
||||||
@@ -57,24 +59,18 @@ jobs:
|
|||||||
throw "Divine.exe was not found in the downloaded LSLib release."
|
throw "Divine.exe was not found in the downloaded LSLib release."
|
||||||
}
|
}
|
||||||
|
|
||||||
"path=$($divine.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
"DIVINE_PATH=$($divine.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
|
||||||
- name: Build .pak
|
- name: Build .pak
|
||||||
shell: pwsh
|
|
||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
New-Item -ItemType Directory -Path "build" -Force | Out-Null
|
& "$env:DIVINE_PATH" -a create-package -g bg3 -s Mods -d build/DnD55eRussian.pak
|
||||||
& "${{ steps.divine.outputs.path }}" -a create-package -g bg3 -s Mods -d build/DnD55eRussian.pak
|
|
||||||
|
|
||||||
- name: Upload build artifact
|
if (-not (Test-Path -LiteralPath "build/DnD55eRussian.pak")) {
|
||||||
uses: actions/upload-artifact@v4
|
throw "Package was not created."
|
||||||
with:
|
}
|
||||||
name: DnD55eRussian-pak
|
|
||||||
path: build/DnD55eRussian.pak
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Attach package to GitHub Release
|
- name: Show build result
|
||||||
if: github.event_name == 'release'
|
run: |
|
||||||
uses: softprops/action-gh-release@v2
|
$ErrorActionPreference = "Stop"
|
||||||
with:
|
Get-ChildItem "build/DnD55eRussian.pak" | Select-Object FullName, Length, LastWriteTime
|
||||||
files: build/DnD55eRussian.pak
|
|
||||||
Reference in New Issue
Block a user