From 7dfa236bc16ca60b06692a30f0bbe147b2d424bc Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Sat, 10 Feb 2024 15:29:36 -0800 Subject: [PATCH] Use v4 actions --- .github/workflows/build.yml | 58 ++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f96ed5c..f769810d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,7 +94,7 @@ jobs: steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 0 @@ -108,12 +108,12 @@ jobs: - name: Cache multiple paths if: matrix.goal == 'build' - uses: actions/cache@v3 + uses: actions/cache@v4 id: cache-python-ssl with: path: | cache.tar.xz - key: gam-${{ matrix.jid }}-20240209a + key: gam-${{ matrix.jid }}-20240210 - name: Untar Cache archive if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit == 'true' @@ -154,6 +154,15 @@ jobs: fi echo "GAMCFGDIR=${GAMCFGDIR}" >> $GITHUB_ENV echo "GAMCFGDIR is: ${GAMCFGDIR}" + if [[ "${RUNNER_OS}" == "macOS" ]]; then + GAMOS="macos" + elif [[ "${RUNNER_OS}" == "Linux" ]]; then + GAMOS="linux" + elif [[ "${RUNNER_OS}" == "Windows" ]]; then + GAMOS="windows" + else + GAMOS='unknown' + fi - name: Set env variables for test if: matrix.goal == 'test' @@ -537,7 +546,7 @@ jobs: export gampath="${distpath}" "${PYTHON}" -m PyInstaller --clean --noconfirm --distpath="${distpath}" gam.spec cat build/gam/warn-gam.txt - + - name: Copy extra package files if: matrix.goal == 'build' run: | @@ -825,16 +834,6 @@ jobs: $gam delete printer "$printerid" $gam delete ou "${newou}" - - name: Archive production artifacts - uses: actions/upload-artifact@v3 - if: (github.event_name == 'push' || github.event_name == 'schedule') && matrix.goal != 'test' - with: - name: gam-binaries - path: | - src/*.tar.xz - src/*.zip - src/*.msi - - name: Tar Cache archive if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit != 'true' working-directory: ${{ github.workspace }} @@ -846,10 +845,35 @@ jobs: fi tar cJvvf cache.tar.xz $tar_folders + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + if: (github.event_name == 'push' || github.event_name == 'schedule') && matrix.goal != 'test' + with: + name: gam-binaries-${{ env.GAMOS }}-${{ env.arch }} + path: | + src/*.tar.xz + src/*.zip + src/*.msi + + merge: + runs-on: ubuntu-latest + needs: build + steps: + - name: Merge Artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: gam-binaries + pattern: gam-binaries-* + + - name: Delete Artifacts + uses: geekyeggo/delete-artifact@v4 + with: + name: gam-binaries-* + publish: if: github.event_name == 'push' runs-on: ubuntu-latest - needs: build + needs: merge permissions: contents: write packages: write @@ -857,13 +881,13 @@ jobs: steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 0 - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 - name: VirusTotal Scan uses: crazy-max/ghaction-virustotal@v3