diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml index dbb7eb63..f6cf1374 100644 --- a/.github/workflows/build-package.yml +++ b/.github/workflows/build-package.yml @@ -1,9 +1,15 @@ name: msys2 dev-latest -on: [workflow_dispatch] -#on: -# push: -# branches: -# - dev +on: + workflow_dispatch: + inputs: + use_ucrt: + description: "Use UCRT64 instead of MINGW64?" + type: choice + default: 'false' + options: + - 'true' + - 'false' + jobs: build: runs-on: windows-latest @@ -13,19 +19,21 @@ jobs: steps: - uses: msys2/setup-msys2@v2 with: - msystem: MINGW64 + msystem: ${{ inputs.use_ucrt == 'true' && 'UCRT64' || 'MINGW64' }} update: true install: git p7zip - uses: actions/checkout@v4 - with: + with: #ref: dev fetch-depth: 0 - id: build name: CI-Build + env: + USE_UCRT: ${{ inputs.use_ucrt == 'true' && '1' || '0' }} run: | - export BUILD_NAME="qimgv-x64_$(git describe --tags)" + export BUILD_NAME="qimgv-$([[ "$USE_UCRT" == 1 ]] && echo ucrt-)x64_$(git describe --tags)" echo "build_name=${BUILD_NAME}" >> $GITHUB_OUTPUT echo "build_file_name=${BUILD_NAME}.7z" >> $GITHUB_OUTPUT ./scripts/build-qimgv.sh @@ -33,7 +41,6 @@ jobs: ls -al echo "running: 7z a qimgv-x64.7z ./${BUILD_NAME}" 7z a qimgv-x64.7z ./${BUILD_NAME} - - uses: actions/upload-artifact@v4 with: name: qimgv-build @@ -49,7 +56,7 @@ jobs: steps: #- run: echo "${{ needs.build.outputs.build_name }}" - uses: actions/download-artifact@v4 - with: + with: name: qimgv-build - name: Rename archive diff --git a/scripts/build-qimgv.sh b/scripts/build-qimgv.sh index 8b2a5fd3..2b2a1379 100644 --- a/scripts/build-qimgv.sh +++ b/scripts/build-qimgv.sh @@ -28,12 +28,18 @@ mkdir -p $BUILD_DIR # ------------------------------------------------------------------------------ echo "UPDATING DEPENDENCY LIST" -wget --progress=dot:mega -O $BUILD_DIR/msys2-build-deps.txt https://raw.githubusercontent.com/easymodo/qimgv-deps-bin/main/msys2-build-deps.txt -wget --progress=dot:mega -O $BUILD_DIR/msys2-dll-deps.txt https://raw.githubusercontent.com/easymodo/qimgv-deps-bin/main/msys2-dll-deps.txt +if [[ -f "$PWD/msys2-build-deps.txt" ]] +then cp "$PWD/msys2-build-deps.txt" "$BUILD_DIR/msys2-build-deps.txt" +else wget --progress=dot:mega -O "$BUILD_DIR/msys2-build-deps.txt" https://raw.githubusercontent.com/easymodo/qimgv-deps-bin/main/msys2-build-deps.txt +fi +if [[ -f "$PWD/msys2-dll-deps.txt" ]] +then cp "$PWD/msys2-dll-deps.txt" "$BUILD_DIR/msys2-dll-deps.txt" +else wget --progress=dot:mega -O "$BUILD_DIR/msys2-dll-deps.txt" https://raw.githubusercontent.com/easymodo/qimgv-deps-bin/main/msys2-dll-deps.txt +fi # ------------------------------------------------------------------------------ echo "INSTALLING MSYS2 BUILD DEPS" -MSYS_DEPS=$(cat $BUILD_DIR/msys2-build-deps.txt | sed 's/\n/ /') +MSYS_DEPS=$(cat $BUILD_DIR/msys2-build-deps.txt | sed "$(echo 's/\n/ /;' $([[ "$USE_UCRT" == 1 ]] && echo s/w64-x86_64/w64-ucrt-x86_64/))") pacman -S $MSYS_DEPS --noconfirm --needed # ------------------------------------------------------------------------------ @@ -165,7 +171,7 @@ mingw32-make -j4 echo "PACKAGING" # 0 - prepare dir cd $SRC_DIR -BUILD_NAME=qimgv-x64_$(git describe --tags) +BUILD_NAME=qimgv-$([[ "$USE_UCRT" == 1 ]] && echo ucrt-)x64_$(git describe --tags) PACKAGE_DIR=$SRC_DIR/$BUILD_NAME rm -rf $PACKAGE_DIR mkdir $PACKAGE_DIR