Update ci.yml
This commit is contained in:
@@ -23,25 +23,48 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITEA_PAT: ${{ secrets.TOKEN }}
|
GITEA_PAT: ${{ secrets.TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
$repoUrl = "https://aiden:${env:GITEA_PAT}@git.f-40.com/aiden/video-shader.git"
|
function Invoke-Git {
|
||||||
$submoduleUrl = "https://aiden:${env:GITEA_PAT}@git.f-40.com/aiden/video-io-3rdParty.git"
|
& git @args
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
exit $LASTEXITCODE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
git init .
|
function Add-GiteaTokenToUrl([string]$url) {
|
||||||
git lfs install --local
|
if ([string]::IsNullOrWhiteSpace($env:GITEA_PAT)) {
|
||||||
git remote add origin "$repoUrl"
|
return $url
|
||||||
git fetch --depth=1 origin "${{ gitea.ref }}"
|
}
|
||||||
git checkout FETCH_HEAD
|
return $url -replace "^https://", "https://aiden:$($env:GITEA_PAT)@"
|
||||||
|
}
|
||||||
|
|
||||||
git lfs pull origin "${{ gitea.ref }}"
|
$serverUrl = "${{ gitea.server_url }}".TrimEnd("/")
|
||||||
git submodule sync --recursive
|
$repository = "${{ gitea.repository }}"
|
||||||
git config submodule.video-io-3rdParty.url "$submoduleUrl"
|
if ([string]::IsNullOrWhiteSpace($serverUrl)) {
|
||||||
git submodule update --init --recursive --depth=1
|
$serverUrl = "https://git.f-40.com"
|
||||||
git -C video-io-3rdParty lfs pull
|
}
|
||||||
|
if ([string]::IsNullOrWhiteSpace($repository)) {
|
||||||
|
$repository = "aiden/video-shader-toys"
|
||||||
|
}
|
||||||
|
$repoUrl = Add-GiteaTokenToUrl "$serverUrl/$repository.git"
|
||||||
|
|
||||||
|
Invoke-Git init .
|
||||||
|
Invoke-Git lfs install --local
|
||||||
|
Invoke-Git remote add origin "$repoUrl"
|
||||||
|
Invoke-Git fetch --depth=1 origin "${{ gitea.ref }}"
|
||||||
|
Invoke-Git checkout FETCH_HEAD
|
||||||
|
|
||||||
|
Invoke-Git lfs pull origin "${{ gitea.ref }}"
|
||||||
|
Invoke-Git submodule sync --recursive
|
||||||
|
$submoduleUrl = Invoke-Git config --file .gitmodules --get submodule.video-io-3rdParty.url
|
||||||
|
$submoduleUrl = Add-GiteaTokenToUrl "$submoduleUrl"
|
||||||
|
Invoke-Git config submodule.video-io-3rdParty.url "$submoduleUrl"
|
||||||
|
Invoke-Git submodule update --init --recursive --depth=1
|
||||||
|
Invoke-Git -C video-io-3rdParty lfs pull
|
||||||
|
|
||||||
Write-Host "Parent LFS files:"
|
Write-Host "Parent LFS files:"
|
||||||
git lfs ls-files
|
Invoke-Git lfs ls-files
|
||||||
Write-Host "Submodule LFS files:"
|
Write-Host "Submodule LFS files:"
|
||||||
git -C video-io-3rdParty lfs ls-files
|
Invoke-Git -C video-io-3rdParty lfs ls-files
|
||||||
|
|
||||||
- name: Verify Visual Studio ATL
|
- name: Verify Visual Studio ATL
|
||||||
shell: powershell
|
shell: powershell
|
||||||
@@ -162,25 +185,48 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITEA_PAT: ${{ secrets.TOKEN }}
|
GITEA_PAT: ${{ secrets.TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
$repoUrl = "https://aiden:${env:GITEA_PAT}@git.f-40.com/aiden/video-shader.git"
|
function Invoke-Git {
|
||||||
$submoduleUrl = "https://aiden:${env:GITEA_PAT}@git.f-40.com/aiden/video-io-3rdParty.git"
|
& git @args
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
exit $LASTEXITCODE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
git init .
|
function Add-GiteaTokenToUrl([string]$url) {
|
||||||
git lfs install --local
|
if ([string]::IsNullOrWhiteSpace($env:GITEA_PAT)) {
|
||||||
git remote add origin "$repoUrl"
|
return $url
|
||||||
git fetch --depth=1 origin "${{ gitea.ref }}"
|
}
|
||||||
git checkout FETCH_HEAD
|
return $url -replace "^https://", "https://aiden:$($env:GITEA_PAT)@"
|
||||||
|
}
|
||||||
|
|
||||||
git lfs pull origin "${{ gitea.ref }}"
|
$serverUrl = "${{ gitea.server_url }}".TrimEnd("/")
|
||||||
git submodule sync --recursive
|
$repository = "${{ gitea.repository }}"
|
||||||
git config submodule.video-io-3rdParty.url "$submoduleUrl"
|
if ([string]::IsNullOrWhiteSpace($serverUrl)) {
|
||||||
git submodule update --init --recursive --depth=1
|
$serverUrl = "https://git.f-40.com"
|
||||||
git -C video-io-3rdParty lfs pull
|
}
|
||||||
|
if ([string]::IsNullOrWhiteSpace($repository)) {
|
||||||
|
$repository = "aiden/video-shader-toys"
|
||||||
|
}
|
||||||
|
$repoUrl = Add-GiteaTokenToUrl "$serverUrl/$repository.git"
|
||||||
|
|
||||||
|
Invoke-Git init .
|
||||||
|
Invoke-Git lfs install --local
|
||||||
|
Invoke-Git remote add origin "$repoUrl"
|
||||||
|
Invoke-Git fetch --depth=1 origin "${{ gitea.ref }}"
|
||||||
|
Invoke-Git checkout FETCH_HEAD
|
||||||
|
|
||||||
|
Invoke-Git lfs pull origin "${{ gitea.ref }}"
|
||||||
|
Invoke-Git submodule sync --recursive
|
||||||
|
$submoduleUrl = Invoke-Git config --file .gitmodules --get submodule.video-io-3rdParty.url
|
||||||
|
$submoduleUrl = Add-GiteaTokenToUrl "$submoduleUrl"
|
||||||
|
Invoke-Git config submodule.video-io-3rdParty.url "$submoduleUrl"
|
||||||
|
Invoke-Git submodule update --init --recursive --depth=1
|
||||||
|
Invoke-Git -C video-io-3rdParty lfs pull
|
||||||
|
|
||||||
Write-Host "Parent LFS files:"
|
Write-Host "Parent LFS files:"
|
||||||
git lfs ls-files
|
Invoke-Git lfs ls-files
|
||||||
Write-Host "Submodule LFS files:"
|
Write-Host "Submodule LFS files:"
|
||||||
git -C video-io-3rdParty lfs ls-files
|
Invoke-Git -C video-io-3rdParty lfs ls-files
|
||||||
|
|
||||||
- name: Verify Visual Studio ATL
|
- name: Verify Visual Studio ATL
|
||||||
shell: powershell
|
shell: powershell
|
||||||
|
|||||||
Reference in New Issue
Block a user