From 17c6c775e3e2b1ff304caab330104e0ea829c455 Mon Sep 17 00:00:00 2001 From: ptahmose Date: Thu, 3 Oct 2024 02:48:45 +0200 Subject: [PATCH] Add artifact preparation and update upload step Removed commented-out lines for `MEXLIBCZI_HEADERS` and `MEXLIBCZI_LIBS` in the `cmake` command. Noted potential redundancy with duplicated `cmake --build . --config Release` command. Added "Prepare artifact" step: - Uses `bash` shell. - Creates `artifacts` directory. - Constructs artifact name using `MEXlibCZI-linux-x64-`. - Copies `MEXlibCZI.mexa64` to artifact directory. - Sets `artifactName` and `artifactPath` environment variables. Updated "Upload artifacts" step to use `actions/upload-artifact@v4` and upload using the set environment variables. --- .github/workflows/build_linuxx64.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_linuxx64.yml b/.github/workflows/build_linuxx64.yml index a8cf3b1..637bae1 100644 --- a/.github/workflows/build_linuxx64.yml +++ b/.github/workflows/build_linuxx64.yml @@ -25,4 +25,18 @@ jobs: cd build #cmake .. -DCMAKE_BUILD_TYPE=Release -DMEXLIBCZI_HEADERS=$MATLAB_HEADER_PATH -DMEXLIBCZI_LIBS=$MATLAB_LIB_PATH cmake .. -DCMAKE_BUILD_TYPE=Release - cmake --build . --config Release \ No newline at end of file + cmake --build . --config Release + - name: Prepare artifact + shell: bash + run: | + mkdir -p artifacts + name="MEXlibCZI-linux-x64-$(git describe --always)" + mkdir -p artifacts/${name} + cp build/MEXlibCZI/MEXlibCZI.mexa64 artifacts/${name}/ + echo "artifactName=${name}" >> "$GITHUB_ENV" + echo "artifactPath=artifacts/${name}" >> "$GITHUB_ENV" + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + path: ${{ env.artifactPath }}/ + name: ${{ env.artifactName }} \ No newline at end of file