CI: Don't use set-env

Clean up paths-ignore.
Use better release action.
This commit is contained in:
Margen67 2020-11-25 11:41:04 -08:00 committed by GitHub
parent b7ad547eef
commit d853a92623
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 20 deletions

View File

@ -5,19 +5,19 @@ on:
branches-ignore: [ gh-pages, master ] branches-ignore: [ gh-pages, master ]
paths-ignore: paths-ignore:
- '.github/*' - '.github/*'
- '.github/ISSUE_TEMPLATE/**' - '.github/*_TEMPLATE/**'
- 'docs/**'
- '*.md' - '*.md'
- '*.yml' - '*.yml'
- 'docs/**'
- 'LICENSE' - 'LICENSE'
pull_request: pull_request:
branches-ignore: [ gh-pages, master ] branches-ignore: [ gh-pages, master ]
paths-ignore: paths-ignore:
- '.github/*' - '.github/*'
- '.github/ISSUE_TEMPLATE/**' - '.github/*_TEMPLATE/**'
- 'docs/**'
- '*.md' - '*.md'
- '*.yml' - '*.yml'
- 'docs/**'
- 'LICENSE' - 'LICENSE'
jobs: jobs:
@ -38,13 +38,14 @@ jobs:
- name: Build - name: Build
run: .\xb build --cpu_arch=${{ matrix.cpu_arch }} --config=Release --target=src\xenia-app --target=src\xenia-vfs-dump run: .\xb build --cpu_arch=${{ matrix.cpu_arch }} --config=Release --target=src\xenia-app --target=src\xenia-vfs-dump
- name: Prepare artifacts - name: Prepare artifacts
id: prepare_artifacts
run: | run: |
robocopy . build\bin\${{ runner.os }}\Release LICENSE /r:0 /w:0 robocopy . build\bin\${{ runner.os }}\Release LICENSE /r:0 /w:0
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_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 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 } If ($LastExitCode -le 7) { echo "LastExitCode = $LastExitCode";$LastExitCode = 0 }
7z a -mx1 xenia_canary.zip .\artifacts\xenia_canary\*.exe LICENSE 7z a -mx1 xenia_canary.zip .\artifacts\xenia_canary\*.exe LICENSE
echo "::set-env name=short_commit_sha::$(git rev-parse --short HEAD)" echo "::set-output name=short_commit_sha::$(git rev-parse --short HEAD)"
- name: Upload xenia-vfs-dump artifacts - name: Upload xenia-vfs-dump artifacts
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
if: matrix.cpu_arch == 'AVX' if: matrix.cpu_arch == 'AVX'
@ -58,20 +59,16 @@ jobs:
name: xenia_canary_${{ matrix.cpu_arch }} name: xenia_canary_${{ matrix.cpu_arch }}
path: artifacts\xenia_canary path: artifacts\xenia_canary
if-no-files-found: error if-no-files-found: error
- uses: actions/create-release@v1 - uses: softprops/action-gh-release@v1
if: github.repository == 'xenia-canary/xenia-canary' && github.event.action != 'pull_request' && contains(github.ref, 'refs/heads/canary') && matrix.cpu_arch == 'AVX' if: |
id: create_release github.event.action != 'pull_request' &&
matrix.cpu_arch == 'AVX'
# github.repository == 'xenia-canary/xenia-canary' &&
# github.event.action != 'pull_request' &&
# contains(github.ref, 'refs/heads/canary') &&
# matrix.cpu_arch == 'AVX'
with:
files: '*.zip'
tag_name: ${{ steps.prepare_artifacts.outputs.short_commit_sha }}
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.short_commit_sha }}
release_name: xenia_canary_${{ env.short_commit_sha }}
- uses: actions/upload-release-asset@v1
if: github.repository == 'xenia-canary/xenia-canary' && github.event.action != 'pull_request' && contains(github.ref, 'refs/heads/canary') && matrix.cpu_arch == 'AVX'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: xenia_canary.zip
asset_name: xenia_canary.zip
asset_content_type: application/zip