From 6539093dee0761ef2d4dc8c6b7729703b085fc10 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Sat, 11 Jan 2025 22:21:21 +0100 Subject: [PATCH 1/2] Upload artifacts in CI pipeline --- .github/workflows/build.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2bdbac67..bf392cd0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,12 +27,15 @@ jobs: - { name: "Windows MSVC", os: "windows-2022", generator: "Visual Studio 17 2022"} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -G "${{matrix.config.generator}}" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DARMIPS_USE_STD_FILESYSTEM=ON + run: cmake -B ${{github.workspace}}/build -G "${{matrix.config.generator}}" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DARMIPS_USE_STD_FILESYSTEM=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install env: CC: ${{matrix.config.cc}} CXX: ${{matrix.config.cxx}} @@ -47,3 +50,16 @@ jobs: # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure + - name: Install + shell: bash + run: | + cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install + VERSION=$(git -C ${{github.workspace}} describe --first-parent) + PLATFORM=$(echo ${{matrix.config.name}} | tr '[:upper:]' '[:lower:'] | sed 's/ /_/g') + echo "FILENAME=armips_${VERSION}_${PLATFORM}" >> $GITHUB_ENV + + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: ${{env.FILENAME}} + path: ${{github.workspace}}/install From 00c394fea63881924b388e24380f2ceb2c09f530 Mon Sep 17 00:00:00 2001 From: adakite1 Date: Wed, 5 Mar 2025 19:19:00 +0800 Subject: [PATCH 2/2] Use single quotes around workspace path inside actions so that windows builds do not break at the install step from bash interpreting the backslashes as escape characters. --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf392cd0..72792a4b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,8 +53,8 @@ jobs: - name: Install shell: bash run: | - cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install - VERSION=$(git -C ${{github.workspace}} describe --first-parent) + cmake --build '${{github.workspace}}/build' --config ${{env.BUILD_TYPE}} --target install + VERSION=$(git -C '${{github.workspace}}' describe --first-parent) PLATFORM=$(echo ${{matrix.config.name}} | tr '[:upper:]' '[:lower:'] | sed 's/ /_/g') echo "FILENAME=armips_${VERSION}_${PLATFORM}" >> $GITHUB_ENV