workflow: fix artifact path, git commit
@@ -18,6 +18,21 @@ jobs:
run: |
sudo apt update
sudo apt install gcc-multilib g++-multilib ninja-build python3-setuptools python3-wheel mesa-common-dev libxnvctrl-dev libdbus-1-dev
+ - 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: Build release package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -40,6 +55,6 @@ jobs:
uses: actions/upload-artifact@v2
continue-on-error: true
with:
- name: MangoHud-${{github.ref}}-${{github.sha}}
- path: ${{runner.workspace}}/build/MangoHud-*tar.gz
+ name: MangoHud-${{steps.git-vars.outputs.artifact-metadata}}
+ path: ${{runner.workspace}}/MangoHud/build/MangoHud-*tar.gz
retention-days: 30
\ No newline at end of file
