CI: Use gh release create

Move archive creation to create release step.
Error if archive is too small.
This commit is contained in:
Margen67 2021-06-23 07:18:28 -10:00 committed by Gliniak
parent c3d6bdee54
commit 1f0b8245b1
1 changed files with 10 additions and 14 deletions

View File

@ -42,7 +42,6 @@ jobs:
robocopy build\bin\${{ runner.os }}\Release artifacts\xenia_canary xenia_canary.exe xenia_canary.pdb LICENSE /r:0 /w:0
robocopy build\bin\${{ runner.os }}\Release artifacts\xenia-vfs-dump xenia-vfs-dump.exe xenia-vfs-dump.pdb LICENSE /r:0 /w:0
If ($LastExitCode -le 7) { echo "LastExitCode = $LastExitCode";$LastExitCode = 0 }
7z a xenia_canary.zip .\artifacts\xenia_canary\*.exe LICENSE
- name: Upload xenia-vfs-dump artifacts
uses: actions/upload-artifact@v2
with:
@ -55,22 +54,19 @@ jobs:
name: xenia_canary
path: artifacts\xenia_canary
if-no-files-found: error
- name: Set release parameters
- name: Create release
if: |
github.repository == 'xenia-canary/xenia-canary' &&
github.event.action != 'pull_request' &&
contains(github.ref, 'refs/heads/canary')
id: release_parameters
run: |
$tag_name=$env:GITHUB_SHA.SubString(0,7)
echo "::set-output name=name::$tag_name_$($env:GITHUB_REF -replace 'refs/heads/', '')"
echo "::set-output name=tag_name::$tag_name"
- uses: softprops/action-gh-release@9729932bfb75c05ad1f6e3a729294e05abaa7001
if: success()
with:
files: '*.zip'
name: ${{ steps.release_parameters.outputs.name }}
tag_name: ${{ steps.release_parameters.outputs.tag_name }}
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$asset="xenia_canary.zip"
7z a $asset .\artifacts\xenia_canary\*.exe LICENSE
If ($(Get-Item $asset).length -le 100000) {
Throw "Error: Archive $asset too small!"
}
$tag=$env:GITHUB_SHA.SubString(0,7)
$title="${tag}_$($env:GITHUB_REF -replace 'refs/heads/', '')"
gh release create $tag $asset --target $env:GITHUB_SHA -t $title