msvc: add package function and tweak github action

This commit is contained in:
bnnm 2021-08-13 23:52:26 +02:00
parent a38ca51139
commit a6fc7546fe
3 changed files with 91 additions and 58 deletions

View File

@ -24,7 +24,7 @@ jobs:
shell: cmd
run: git fetch --prune --unshallow --tags
- name: Initialize Build Environment
- name: Initialize build environment
shell: cmd
run: powershell -ExecutionPolicy Bypass -NoProfile -File .\msvc-build.ps1 Init
@ -33,77 +33,35 @@ jobs:
shell: cmd
run: powershell -ExecutionPolicy Bypass -NoProfile -File .\msvc-build.ps1 Build
- name: Prepare Files For Packaging
- name: Prepare files for packaging
shell: powershell
run: |
$fb2kFiles = @(
"ext_libs/*.dll",
"ext_libs/libspeex/*.dll",
"Release/foo_input_vgmstream.dll",
"README.md"
)
run: powershell -ExecutionPolicy Bypass -NoProfile -File .\msvc-build.ps1 PackageTmp
$cliFiles = @(
"ext_libs/*.dll",
"ext_libs/libspeex/*.dll",
"Release/in_vgmstream.dll",
"Release/test.exe",
"Release/xmp-vgmstream.dll",
"COPYING",
"README.md"
)
$fb2kPdbFiles = @(
"Release/foo_input_vgmstream.pdb"
)
$cliPdbFiles = @(
"Release/in_vgmstream.pdb",
"Release/test.pdb",
"Release/xmp-vgmstream.pdb"
)
Compress-Archive $cliFiles Release/vgmstream-win.zip -Force
Compress-Archive $fb2kFiles Release/foo_input_vgmstream.zip -Force
Move-Item Release/foo_input_vgmstream.zip Release/foo_input_vgmstream.fb2k-component -Force
Compress-Archive $cliPdbFiles Release/test.pdb.zip -Force
Compress-Archive $fb2kPdbFiles Release/foo_input_vgmstream.pdb.zip -Force
mkdir tmp/cli
mkdir tmp/fb2k
mkdir tmp/cli-p
mkdir tmp/fb2k-p
Copy-Item $cliFiles tmp/cli/ -Recurse -Force
Copy-Item $fb2kFiles tmp/fb2k/ -Recurse -Force
Copy-Item $cliPdbFiles tmp/cli-p/ -Recurse -Force
Copy-Item $fb2kPdbFiles tmp/fb2k-p/ -Recurse -Force
- name: Upload foobar2000 Component Artifact
- name: Upload foobar2000 component artifact
uses: actions/upload-artifact@v2
with:
name: foo_input_vgmstream.fb2k-component
path: ${{github.workspace}}\tmp\fb2k
- name: Upload CLI Tools Artifact
- name: Upload CLI tools artifact
uses: actions/upload-artifact@v2
with:
name: test
name: vgmstream-win
path: ${{github.workspace}}\tmp\cli
- name: Upload foobar2000 Component Debug Symbols Artifact
- name: Upload foobar2000 component debug symbols artifact
uses: actions/upload-artifact@v2
with:
name: foo_input_vgmstream.pdb
path: ${{github.workspace}}\tmp\fb2k-p
- name: Upload CLI Tools Debug Symbols Artifact
- name: Upload CLI tools bebug symbols artifact
uses: actions/upload-artifact@v2
with:
name: test.pdb
name: vgmstream-win.pdb
path: ${{github.workspace}}\tmp\cli-p
- name: Upload Artifacts to S3
- name: Upload artifacts to S3
if: github.event_name != 'pull_request'
working-directory: ${{github.workspace}}
shell: powershell
@ -112,10 +70,10 @@ jobs:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
run: |
aws s3 cp Release\vgmstream-win.zip s3://vgmstream-builds/${{github.sha}}/windows/ --acl public-read
aws s3 cp Release\foo_input_vgmstream.fb2k-component s3://vgmstream-builds/${{github.sha}}/windows/ --acl public-read
aws s3 cp Release\test.pdb.zip s3://vgmstream-builds/${{github.sha}}/windows/ --acl public-read
aws s3 cp Release\foo_input_vgmstream.pdb.zip s3://vgmstream-builds/${{github.sha}}/windows/ --acl public-read
aws s3 cp bin\vgmstream-win.zip s3://vgmstream-builds/${{github.sha}}/windows/ --acl public-read
aws s3 cp bin\foo_input_vgmstream.fb2k-component s3://vgmstream-builds/${{github.sha}}/windows/ --acl public-read
aws s3 cp bin\vgmstream-win.pdb.zip s3://vgmstream-builds/${{github.sha}}/windows/ --acl public-read
aws s3 cp bin\foo_input_vgmstream.pdb.zip s3://vgmstream-builds/${{github.sha}}/windows/ --acl public-read
echo ${{github.sha}} | tee latest_id
git describe --always | tee latest_ver
aws s3 cp latest_id s3://vgmstream-builds/ --acl public-read
@ -126,4 +84,3 @@ jobs:
if: github.event_name != 'pull_request'
with:
url: https://vgmstream-builds.losno.co/callFupa?secret=${{ secrets.FUPA_UPDATER_SECRET }}

6
.gitignore vendored
View File

@ -45,11 +45,17 @@ Release
/xmplay/*.dll
/dependencies
/version_auto.h
/msvc-build.config.ps1
/msvc-build.log
# for test batchs, note that already tracked files are never ignored
/msvc-build-*.bat
/bin/**/*
/tmp/**/*
/**/vgmstream-win.zip
/**/foo_input_vgmstream.fb2k-component
# cmake stuff
/build
/cmake-build*

View File

@ -1,7 +1,7 @@
[CmdletBinding()]
Param(
[Parameter(Position=0, mandatory=$true)]
[ValidateSet("Init", "Build", "Rebuild", "Clean")]
[ValidateSet("Init", "Build", "Rebuild", "Clean", "Package", "PackageTmp")]
[string]$Task
)
@ -145,6 +145,7 @@ function Rebuild
{
CallMsbuild "Rebuild"
}
function Clean
{
CallMsbuild "Clean"
@ -166,12 +167,81 @@ function Clean
Remove-Item -Path "xmplay/Release" -Recurse -ErrorAction Ignore
Remove-Item -Path "Debug" -Recurse -ErrorAction Ignore
Remove-Item -Path "Release" -Recurse -ErrorAction Ignore
Remove-Item -Path "bin" -Recurse -ErrorAction Ignore
Remove-Item -Path "tmp" -Recurse -ErrorAction Ignore
}
$fb2kFiles = @(
"ext_libs/*.dll",
"ext_libs/libspeex/*.dll",
"Release/foo_input_vgmstream.dll",
"README.md"
)
$cliFiles = @(
"ext_libs/*.dll",
"ext_libs/libspeex/*.dll",
"Release/in_vgmstream.dll",
"Release/test.exe",
"Release/xmp-vgmstream.dll",
"COPYING",
"README.md"
)
$fb2kPdbFiles = @(
"Release/foo_input_vgmstream.pdb"
)
$cliPdbFiles = @(
"Release/in_vgmstream.pdb",
"Release/test.pdb",
"Release/xmp-vgmstream.pdb"
)
function Package
{
if(!(Test-Path "Release/test.exe")) { Build }
if(!(Test-Path "Release/test.exe")) {
Write-Error "Unable to find binaries, check for compilation errors"
}
Compress-Archive $cliFiles Release/vgmstream-win.zip -Force
Compress-Archive $fb2kFiles Release/foo_input_vgmstream.zip -Force
Compress-Archive $cliPdbFiles Release/vgmstream-win.pdb.zip -Force
Compress-Archive $fb2kPdbFiles Release/foo_input_vgmstream.pdb.zip -Force
md -Force bin
Move-Item Release/vgmstream-win.zip bin/vgmstream-win.zip -Force
Move-Item Release/foo_input_vgmstream.zip bin/foo_input_vgmstream.fb2k-component -Force
Move-Item Release/vgmstream-win.pdb.zip bin/vgmstream-win.pdb.zip -Force
Move-Item Release/foo_input_vgmstream.pdb.zip bin/foo_input_vgmstream.pdb.zip -Force
}
# for github actions/artifact uploads, that use a dir with files
function PackageTmp
{
Package
md -Force tmp/cli
md -Force tmp/fb2k
md -Force tmp/cli-p
md -Force tmp/fb2k-p
Copy-Item $cliFiles tmp/cli/ -Recurse -Force
Copy-Item $fb2kFiles tmp/fb2k/ -Recurse -Force
Copy-Item $cliPdbFiles tmp/cli-p/ -Recurse -Force
Copy-Item $fb2kPdbFiles tmp/fb2k-p/ -Recurse -Force
}
switch ($Task)
{
"Init" { Init }
"Build" { Build }
"Rebuild" { Rebuild }
"Clean" { Clean }
"Package" { Package }
"PackageTmp" { PackageTmp }
}