From ad22e2cfac7165d16ca50abd23c35178eb940952 Mon Sep 17 00:00:00 2001 From: tGecko Date: Sun, 1 Sep 2024 17:24:53 +0200 Subject: [PATCH] include build date use pwsh instead of cmd on windows workflows --- .github/workflows/linux-qt.yml | 10 ++++++---- .github/workflows/linux.yml | 12 +++++++----- .github/workflows/macos-qt.yml | 11 +++++++---- .github/workflows/macos.yml | 10 ++++++---- .github/workflows/windows-qt.yml | 12 ++++++------ .github/workflows/windows.yml | 12 ++++++------ 6 files changed, 38 insertions(+), 29 deletions(-) diff --git a/.github/workflows/linux-qt.yml b/.github/workflows/linux-qt.yml index efafb6e5..06e048c0 100644 --- a/.github/workflows/linux-qt.yml +++ b/.github/workflows/linux-qt.yml @@ -34,12 +34,14 @@ jobs: - name: Run AppImage packaging script run: ./.github/linux-appimage-qt.sh - - name: Retrieve Git Hash - id: git-hash - run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Get date and git hash + id: vars + run: | + echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + echo "shorthash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Upload executable uses: actions/upload-artifact@v4 with: - name: shadps4-linux-qt-${{ steps.git-hash.outputs.hash }} + name: shadps4-linux-qt-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.shorthash }} path: Shadps4-qt.AppImage \ No newline at end of file diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 081e3259..ee134098 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -31,14 +31,16 @@ jobs: - name: Build run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel - - name: Retrieve Git Hash - id: git-hash - run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Get date and git hash + id: vars + run: | + echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + echo "shorthash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Upload executable uses: actions/upload-artifact@v4 with: - name: shadps4-ubuntu64-${{ steps.git-hash.outputs.hash }} + name: shadps4-ubuntu64-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.shorthash }} path: | ${{github.workspace}}/build/shadps4 @@ -48,5 +50,5 @@ jobs: - name: Upload executable uses: actions/upload-artifact@v4 with: - name: shadps4-sdl-appimage-${{ steps.git-hash.outputs.hash }} + name: shadps4-sdl-appimage-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.shorthash }} path: Shadps4-sdl.AppImage diff --git a/.github/workflows/macos-qt.yml b/.github/workflows/macos-qt.yml index 2b94c7b0..f04d3091 100644 --- a/.github/workflows/macos-qt.yml +++ b/.github/workflows/macos-qt.yml @@ -53,12 +53,15 @@ jobs: macdeployqt upload/shadps4.app tar cf shadps4-macos-qt.tar.gz -C upload . - - name: Retrieve Git Hash - id: git-hash - run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Get date and git hash + id: vars + run: | + echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + echo "shorthash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Upload executable uses: actions/upload-artifact@v4 with: - name: shadps4-macos-qt-${{ steps.git-hash.outputs.hash }} + name: shadps4-macos-qt-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.shorthash }} path: shadps4-macos-qt.tar.gz diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 451b06e8..0eb0ad17 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -45,12 +45,14 @@ jobs: install_name_tool -add_rpath "@loader_path" upload/shadps4 tar cf shadps4-macos-sdl.tar.gz -C upload . - - name: Retrieve Git Hash - id: git-hash - run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Get date and git hash + id: vars + run: | + echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + echo "shorthash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Upload executable uses: actions/upload-artifact@v4 with: - name: shadps4-macos-sdl-${{ steps.git-hash.outputs.hash }} + name: shadps4-macos-sdl-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.shorthash }} path: shadps4-macos-sdl.tar.gz diff --git a/.github/workflows/windows-qt.yml b/.github/workflows/windows-qt.yml index 8b543005..83b1a908 100644 --- a/.github/workflows/windows-qt.yml +++ b/.github/workflows/windows-qt.yml @@ -42,15 +42,15 @@ jobs: move build/Release/shadPS4.exe upload windeployqt --dir upload upload/shadPS4.exe - - name: Retrieve Git Hash - id: git-hash - shell: cmd + - name: Get date and git hash + id: vars + shell: pwsh run: | - FOR /F "tokens=*" %%g IN ('git rev-parse --short HEAD') do (SET HASH=%%g) - echo hash=%HASH% >> %GITHUB_OUTPUT% + echo "date=$(Get-Date -Format 'yyyy-MM-dd')" >> $env:GITHUB_OUTPUT + echo "shorthash=$(git rev-parse --short HEAD)" >> $env:GITHUB_OUTPUT - name: Upload executable uses: actions/upload-artifact@v4 with: - name: shadps4-win64-qt-${{ steps.git-hash.outputs.hash }} + name: shadps4-win64-qt-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.shorthash }} path: upload diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a2beae62..41327792 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -26,16 +26,16 @@ jobs: - name: Build run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel - - name: Retrieve Git Hash - id: git-hash - shell: cmd + - name: Get date and git hash + id: vars + shell: pwsh run: | - FOR /F "tokens=*" %%g IN ('git rev-parse --short HEAD') do (SET HASH=%%g) - echo hash=%HASH% >> %GITHUB_OUTPUT% + echo "date=$(Get-Date -Format 'yyyy-MM-dd')" >> $env:GITHUB_OUTPUT + echo "shorthash=$(git rev-parse --short HEAD)" >> $env:GITHUB_OUTPUT - name: Upload executable uses: actions/upload-artifact@v4 with: - name: shadps4-win64-sdl-${{ steps.git-hash.outputs.hash }} + name: shadps4-win64-sdl-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.shorthash }} path: | ${{github.workspace}}/build/Release/shadPS4.exe