mirror of
https://github.com/mhx/dwarfs.git
synced 2025-08-04 10:16:34 -04:00
chore: try artifact upload in workflow
This commit is contained in:
parent
bb9810a94c
commit
d5955f06d7
@ -157,5 +157,11 @@ if [[ "-$BUILD_TYPE-" == *-static-* ]]; then
|
||||
|
||||
$BUILD_TOOL copy_artifacts
|
||||
|
||||
rm -rf /tmp-runner/artifacts
|
||||
mkdir -p /tmp-runner/artifacts
|
||||
cp artifacts.env /tmp-runner
|
||||
cp dwarfs-universal-* /tmp-runner/artifacts
|
||||
cp dwarfs-*-Linux*.tar.zst /tmp-runner/artifacts
|
||||
|
||||
$BUILD_TOOL realclean
|
||||
fi
|
||||
|
45
.github/workflows/build.yml
vendored
45
.github/workflows/build.yml
vendored
@ -69,6 +69,29 @@ jobs:
|
||||
cmake --build ${{ runner.temp }}\build --target copy_artifacts
|
||||
if: matrix.build_mode == 'Release'
|
||||
|
||||
- name: Prepare Artifact Upload
|
||||
shell: cmd
|
||||
run: cat ${{ runner.temp }}\build\artifacts.env >> %GITHUB_ENV%
|
||||
if: matrix.build_mode == 'Release'
|
||||
|
||||
- name: Upload Binary Tarball
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.binary_tarball }}
|
||||
path: ${{ runner.temp }}\build\${{ env.binary_tarball }}
|
||||
if-no-files-found: error
|
||||
compression-level: 0
|
||||
if: matrix.build_mode == 'Release'
|
||||
|
||||
- name: Upload Universal Binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.universal_binary }}
|
||||
path: ${{ runner.temp }}\build\${{ env.universal_binary }}
|
||||
if-no-files-found: error
|
||||
compression-level: 0
|
||||
if: matrix.build_mode == 'Release'
|
||||
|
||||
linux:
|
||||
strategy:
|
||||
matrix:
|
||||
@ -148,3 +171,25 @@ jobs:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ${{ steps.coverage-files.outputs.list }}
|
||||
fail_ci_if_error: true
|
||||
|
||||
- name: Prepare Artifact Upload
|
||||
run: cat ${{ runner.temp }}/artifacts.env >> $GITHUB_ENV
|
||||
if: ${{ endsWith(matrix.build_type, '-static') }}
|
||||
|
||||
- name: Upload Binary Tarball
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.binary_tarball }}
|
||||
path: ${{ runner.temp }}/artifacts/${{ env.binary_tarball }}
|
||||
if-no-files-found: error
|
||||
compression-level: 0
|
||||
if: ${{ endsWith(matrix.build_type, '-static') }}
|
||||
|
||||
- name: Upload Universal Binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.universal_binary }}
|
||||
path: ${{ runner.temp }}/artifacts/${{ env.universal_binary }}
|
||||
if-no-files-found: error
|
||||
compression-level: 0
|
||||
if: ${{ endsWith(matrix.build_type, '-static') }}
|
||||
|
@ -1000,6 +1000,7 @@ add_custom_target(
|
||||
vcpkg-manifest-install.log
|
||||
build.ninja .ninja_deps
|
||||
Makefile compile_commands.json
|
||||
artifacts.env
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E rm -rf ${REALCLEAN_FILES}
|
||||
)
|
||||
@ -1093,6 +1094,10 @@ if(STATIC_BUILD_DO_NOT_USE OR WIN32)
|
||||
set(PACKAGE_EXT ".tar.zst")
|
||||
endif()
|
||||
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/artifacts.env"
|
||||
"binary_tarball=${CMAKE_PROJECT_NAME}-${DWARFS_ARTIFACT_ID}${PACKAGE_EXT}\n"
|
||||
"universal_binary=${UNIVERSAL_PACKED}\n")
|
||||
|
||||
add_custom_target(copy_artifacts
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ARTIFACTS_FULL_PATH}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${DWARFS_ARTIFACT_ID}${PACKAGE_EXT} ${ARTIFACTS_FULL_PATH}
|
||||
|
Loading…
x
Reference in New Issue
Block a user