mirror of https://github.com/PCSX2/pcsx2.git
ci: Improve windows artifact name
Add PR title if applicable, limit the length of the file to avoid file-name length issues. Also put all contents of the artifact into a folder with the same name to simplify extraction.
This commit is contained in:
parent
89991594de
commit
9031c24fc7
|
@ -42,11 +42,11 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# NOTE - useful for debugging
|
# NOTE - useful for debugging
|
||||||
# - name: Dump GitHub context
|
- name: Dump GitHub context
|
||||||
# env:
|
env:
|
||||||
# GITHUB_CONTEXT: ${{ toJson(github) }}
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
# run: |
|
run: |
|
||||||
# echo "$GITHUB_CONTEXT"
|
echo "$GITHUB_CONTEXT"
|
||||||
|
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -67,22 +67,6 @@ jobs:
|
||||||
if: steps.cache-submodules.outputs.cache-hit != 'true'
|
if: steps.cache-submodules.outputs.cache-hit != 'true'
|
||||||
run: git submodule update --init --recursive --jobs 2
|
run: git submodule update --init --recursive --jobs 2
|
||||||
|
|
||||||
- name: Prepare Artifact Git Info
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
|
|
||||||
ARTIFACT_NAME="commit-$(git rev-parse --short "$GITHUB_SHA")"
|
|
||||||
if [ ${{ github.event_name == 'pull_request' }} ]; then
|
|
||||||
echo "##[set-output name=short-sha;]$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")"
|
|
||||||
if [ ! -z "${{ github.event.pull_request.number }}" ]; then
|
|
||||||
ARTIFACT_NAME="pr-${{ github.event.pull_request.number }}-commit-$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "##[set-output name=short-sha;]$(git rev-parse --short "$GITHUB_SHA")"
|
|
||||||
fi
|
|
||||||
echo "##[set-output name=artifact-metadata;]${ARTIFACT_NAME}"
|
|
||||||
id: git-vars
|
|
||||||
|
|
||||||
- name: Verify VS Project Files
|
- name: Verify VS Project Files
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: .\.github\workflows\scripts\windows\validate-vs-filters.ps1
|
run: .\.github\workflows\scripts\windows\validate-vs-filters.ps1
|
||||||
|
@ -95,10 +79,45 @@ jobs:
|
||||||
- name: Build PCSX2
|
- name: Build PCSX2
|
||||||
run: msbuild "buildbot.xml" /m /v:n /t:ReleaseAll /p:Platform=${{ matrix.platform }}
|
run: msbuild "buildbot.xml" /m /v:n /t:ReleaseAll /p:Platform=${{ matrix.platform }}
|
||||||
|
|
||||||
|
- name: Prepare Artifact Metadata
|
||||||
|
id: artifact-metadata
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
ARCH=$([ "${{ matrix.platform }}" == Win32 ] && echo "32bit" || echo "64bit")
|
||||||
|
ARTIFACT_NAME=""
|
||||||
|
if [ ${{ github.event_name }} == "pull_request" ]; then
|
||||||
|
PR_SHA=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
|
||||||
|
ARTIFACT_NAME="PCSX2-${ARCH}"
|
||||||
|
if [ ! -z "${{ github.event.pull_request.number }}" ]; then
|
||||||
|
PR_NUM=${{ github.event.pull_request.number }}
|
||||||
|
ARTIFACT_NAME="${ARTIFACT_NAME}-pr[${PR_NUM}]"
|
||||||
|
fi
|
||||||
|
ARTIFACT_NAME="${ARTIFACT_NAME}-sha[${PR_SHA}]"
|
||||||
|
if [ ! -z "${{ github.event.pull_request.title }}" ]; then
|
||||||
|
PR_TITLE=$(echo "${{ github.event.pull_request.title }}" | tr -cd '[a-zA-Z0-9[:space:]]_-')
|
||||||
|
ARTIFACT_NAME="${ARTIFACT_NAME}-title["${PR_TITLE}""
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
SHA=$(git rev-parse --short "$GITHUB_SHA")
|
||||||
|
ARTIFACT_NAME="PCSX2-${ARCH}-sha[${SHA}"
|
||||||
|
fi
|
||||||
|
TRIMMED_ARTIFACT_NAME=$(printf "%.199s]" "$ARTIFACT_NAME")
|
||||||
|
echo "name=$TRIMMED_ARTIFACT_NAME"
|
||||||
|
echo "##[set-output name=name;]${TRIMMED_ARTIFACT_NAME}"
|
||||||
|
|
||||||
|
- name: Prepare Artifact Folder
|
||||||
|
shell: bash
|
||||||
|
working-directory: ./bin
|
||||||
|
run: |
|
||||||
|
shopt -s extglob dotglob
|
||||||
|
mkdir "${{ steps.artifact-metadata.outputs.name }}"
|
||||||
|
mv !("${{ steps.artifact-metadata.outputs.name }}") "${{ steps.artifact-metadata.outputs.name }}"
|
||||||
|
shopt -u dotglob
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
name: PCSX2-${{ matrix.platform }}-${{ steps.git-vars.outputs.artifact-metadata }}
|
name: ${{ steps.artifact-metadata.outputs.name }}
|
||||||
path: bin
|
path: bin
|
||||||
retention-days: 30 # https://docs.github.com/en/free-pro-team@latest/actions/reference/usage-limits-billing-and-administration#artifact-and-log-retention-policy
|
retention-days: 30 # https://docs.github.com/en/free-pro-team@latest/actions/reference/usage-limits-billing-and-administration#artifact-and-log-retention-policy
|
||||||
|
|
Loading…
Reference in New Issue