From 1f13033a6cd63adcb869e22dbdf3b7e1cb390150 Mon Sep 17 00:00:00 2001 From: valord577 Date: Fri, 23 Aug 2024 16:31:52 +0800 Subject: [PATCH] gh action ng 2 --- .github/workflows/_matrix.yml | 21 +++++++++++++-------- scripts/ffmpeg.sh | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/_matrix.yml b/.github/workflows/_matrix.yml index 15efe9d..737e08f 100644 --- a/.github/workflows/_matrix.yml +++ b/.github/workflows/_matrix.yml @@ -63,11 +63,16 @@ jobs: strategy: matrix: ${{ fromJson(needs._preset.outputs.matrix) }} runs-on: ${{ matrix.os }} + defaults: + run: + shell: ${{ startsWith('${{ matrix.os }}', 'windows') && 'pwsh' || 'bash' }} + working-directory: ${{ github.workspace }} env: - INST_DIR: "${{ github.workspace }}/${{ github.workflow }}" + INST_DIR: ${{ github.workspace }}/${{ github.workflow }} CCACHE_DIR: ${{ github.workspace }}/.ccache CCACHE_GHA_KEY: ${{ matrix.pkg_type }}-${{ matrix.platform }}-${{ matrix.arch }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }} CCACHE_GHA_KEY_RESTORE: ${{ matrix.pkg_type }}-${{ matrix.platform }}-${{ matrix.arch }} + PKG_ZIP_NAME: ${{ github.workflow }}_${{ matrix.platform }}_${{ matrix.arch }}_${{ needs._preset.outputs.pkgver }}_${{ matrix.pkg_type }} steps: - name: clone with gh run: | @@ -75,7 +80,9 @@ jobs: git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +${{ github.sha }}; git checkout FETCH_HEAD - name: install required software(s) run: | - brew list -l; brew install ccache nasm + if [[ ${{ startsWith('${{ matrix.os }}', 'macos') }} ]]; then + brew list -l; brew install ccache nasm + fi - name: gh action ccache restore uses: actions/cache/restore@v4 with: @@ -92,17 +99,15 @@ jobs: with: path: ${{ env.CCACHE_DIR }} key: ${{ env.CCACHE_GHA_KEY }} - - name: set required env `_PKG_ZIP_NAME` - run: | - echo "_PKG_ZIP_NAME=${{ github.workflow }}_${{ matrix.platform }}_${{ matrix.arch }}_${{ needs._preset.outputs.pkgver }}_${{ matrix.pkg_type }}" >> "$GITHUB_ENV" - name: compress library - ${{ github.workflow }} run: | - zip -ry "${{ env._PKG_ZIP_NAME }}.zip" ${{ github.workflow }} + zip -ry "${{ env.PKG_ZIP_NAME }}.zip" ${{ github.workflow }} - name: upload library - ${{ github.workflow }} uses: actions/upload-artifact@v4 with: - name: ${{ env._PKG_ZIP_NAME }} - path: ${{ env._PKG_ZIP_NAME }}.zip + name: ${{ env.PKG_ZIP_NAME }} + path: ${{ env.PKG_ZIP_NAME }}.zip + _upload: needs: diff --git a/scripts/ffmpeg.sh b/scripts/ffmpeg.sh index 187baf8..7b03658 100755 --- a/scripts/ffmpeg.sh +++ b/scripts/ffmpeg.sh @@ -6,7 +6,7 @@ set -e # ---------------------------- source "${PROJ_ROOT}/pkg-conf.sh" dl_pkgc mbedtls '2ca6c28' static '' '--enable-mbedtls' -dl_pkgc sdl2 'fb14975' static '' '' +dl_pkgc sdl2 'ba2f78a' static '' '' printf "\e[1m\e[35m%s\e[0m\n" "${PKG_CONFIG_PATH}" # ----------------------------