From 0f8bb9bb40dcf871ecf823f808b9940587d6ec48 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Sun, 15 Sep 2024 13:55:44 +0200 Subject: [PATCH] Added workflow for GitHub actions. --- .github/workflows/build-curl.yml | 53 ++++++++++++++++++++++++++++++++ build.sh | 4 +-- 2 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-curl.yml diff --git a/.github/workflows/build-curl.yml b/.github/workflows/build-curl.yml new file mode 100644 index 0000000..6ae3e8c --- /dev/null +++ b/.github/workflows/build-curl.yml @@ -0,0 +1,53 @@ +name: "CI/CD" +on: + push: + branches: ['**'] + pull_request: + release: + types: [published] + +jobs: + build: + name: Build cURL + runs-on: windows-2019 + strategy: + matrix: + include: + - flavor: "x86" + msystem: "MINGW32" + toolchain: "i686" + - flavor: "x64" + msystem: "MINGW64" + toolchain: "x86_64" + steps: + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + update: true + install: mingw-w64-${{ matrix.toolchain }}-toolchain base-devel cmake zip + - uses: actions/checkout@v4 + - shell: msys2 {0} + run: ./build.sh + - uses: actions/upload-artifact@v4 + with: + name: curl-windows-${{ matrix.flavor }} + path: build/curl-*.zip + + release: + name: release files + if: ${{ github.event_name == 'release' }} + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + pattern: curl-windows-* + path: artifacts + merge-multiple: true + - uses: Roang-zero1/github-upload-release-artifacts-action@v2 + with: + args: artifacts/ + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.sh b/build.sh index 9abb398..2b5aaed 100644 --- a/build.sh +++ b/build.sh @@ -6,7 +6,7 @@ # \___|\___/|_| \_\_____| set -e -trap 'read -p "Press any key..." x' EXIT +trap 'read -p "Press any key..." x || true' EXIT # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # cURL version @@ -92,7 +92,7 @@ if [ "$(sed '/^$/d' "${LOCK_FILE}" | head -n1)" != "${SIGNATURE}" ] ; then echo 'Error: Build process is already in progress !!!' exit 1 else - trap "rm -f \"${LOCK_FILE}\"; read -p \"Press any key...\" x" EXIT + trap "{ rm -f \"${LOCK_FILE}\"; read -p \"Press any key...\" x; } || true" EXIT fi # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~