]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
CI: generate and publish build artifacts on GitHub actions
authorMartin Matuska <martin@matuska.org>
Sat, 8 Feb 2020 22:02:53 +0000 (23:02 +0100)
committerMartin Matuska <martin@matuska.org>
Sat, 8 Feb 2020 23:24:39 +0000 (00:24 +0100)
Fixes #1313

.github/workflows/ci.yml
build/ci/build.sh
build/ci/github_actions/ci.cmd

index 510cb9c29155ad29fb6e769f67ad029df675a6b7..2ffa282479b5623543c300549fd78d0486055041 100644 (file)
@@ -33,6 +33,14 @@ jobs:
       run: ./build/ci/build.sh -a install
       env:
         BS: ${{ matrix.bs }}
+    - name: Artifact
+      run: ./build/ci/build.sh -a artifact
+      env:
+        BS: ${{ matrix.bs }}
+    - uses: actions/upload-artifact@v1
+      with:
+        name: libarchive-macos-${{ matrix.bs }}-${{ github.sha }}
+        path: libarchive.tar.xz
 
   Ubuntu:
     runs-on: ubuntu-latest
@@ -66,7 +74,14 @@ jobs:
       run: ./build/ci/build.sh -a install
       env:
         BS: ${{ matrix.bs }}
-
+    - name: Artifact
+      run: ./build/ci/build.sh -a artifact
+      env:
+        BS: ${{ matrix.bs }}
+    - uses: actions/upload-artifact@v1
+      with:
+        name: libarchive-ubuntu-${{ matrix.bs }}-${{ matrix.crypto }}-${{ github.sha }}
+        path: libarchive.tar.xz
   Ubuntu-distcheck:
     runs-on: ubuntu-latest
     steps:
@@ -114,3 +129,12 @@ jobs:
       shell: cmd
       env:
         BE: ${{ matrix.be }}
+    - name: Artifact
+      run: ./build/ci/github_actions/ci.cmd artifact
+      shell: cmd
+      env:
+        BE: ${{ matrix.be }}
+    - uses: actions/upload-artifact@v1
+      with:
+        name: libarchive-windows-${{ matrix.be }}-${{ github.sha }}
+        path: libarchive.zip
index 97d570b5e0160b2abe9b7eba72f96e7ee51604bf..0e0c2fbab0cf2a1c43c6a2e032caa5be911699b9 100755 (executable)
@@ -42,6 +42,7 @@ while getopts a:b:c:d:s: opt; do
                                test) ;;
                                install) ;;
                                distcheck) ;;
+                               artifact) ;;
                                *) inputerror "Invalid action (-a)" ;;
                        esac
                        ACTIONS="${ACTIONS} ${OPTARG}"
@@ -147,12 +148,16 @@ for action in ${ACTIONS}; do
                install)
                        ${MAKE} ${MAKE_ARGS} install DESTDIR="${BUILDDIR}/destdir"
                        RET="$?"
-                       cd ${BUILDDIR}/destdir && ls -lR .
+                       cd "${BUILDDIR}/destdir" && ls -lR .
                ;;
                distcheck)
                        ${MAKE} ${MAKE_ARGS} distcheck
                        RET="$?"
                ;;
+               artifact)
+                       tar -c -J -C "${BUILDDIR}/destdir" -f "${CURDIR}/libarchive.tar.xz" usr
+                       ls -l "${CURDIR}/libarchive.tar.xz"
+               ;;
        esac
        if [ "${RET}" != "0" ]; then
                exit "${RET}"
index d5e625ef9764c52ed0e893bf7e76a009b8503242..37e86c406e036736ebc1d30cc735da7cdaff1e61 100755 (executable)
@@ -94,12 +94,15 @@ IF "%1"=="deplibs" (
   IF "%BE%"=="mingw-gcc" (
     SET PATH=%MINGWPATH%
     CD build_ci\cmake
-    mingw32-make install DESTDIR=%cd%\destdir || EXIT /b 1
+    mingw32-make install || EXIT /b 1
   ) ELSE IF "%BE%"=="msvc" (
-    cmake --build . --target INSTALL --config Release
+    CD build_ci\cmake
+    cmake --build . --target INSTALL --config Release || EXIT /b 1
   )
+) ELSE IF "%1"=="artifact" (
+    tar -c -C "C:\Program Files (x86)" --format=zip -f libarchive.zip libarchive
 ) ELSE (
-  ECHO "Usage: %0% deplibs|configure|build|test|install"
+  ECHO "Usage: %0% deplibs|configure|build|test|install|artifact"
   @EXIT /b 0
 )
 @EXIT /b 0