Skip to content

Commit 769779d

Browse files
committed
Streamline artifact handling in build and release
The changes in the `build.yml` file include the addition of commands to list the contents of the `./artifacts` directory and to create zip archives for each subdirectory within `./artifacts`. Specifically, the script now loops through all directories in `./artifacts`, removes the trailing slash from each directory name, and creates a zip archive with the same name as the folder using the `7z` command. The release step has been modified to upload these newly created zip files instead of individual files. The `files` section of the `softprops/action-gh-release@v2` action now includes a wildcard pattern `./artifacts/*.zip` to match all zip files in the `./artifacts` directory. These changes streamline the release process by zipping the contents of each subdirectory in `./artifacts` and uploading these zip files as part of the release. This reduces the number of individual files specified in the release configuration and simplifies artifact management.
1 parent a3f4d0d commit 769779d

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,21 @@ jobs:
174174
git_version=$(git describe --always)
175175
echo "releaseName=version ${mexlibczi_version} (${git_version})" >> "$GITHUB_ENV"
176176
echo "tagName=v${mexlibczi_version}" >> "$GITHUB_ENV"
177-
177+
ls -l ./artifacts
178+
cd ./artifacts
179+
# Loop through all directories in the current directory
180+
for dir in */; do
181+
# Remove the trailing slash from the directory name
182+
folder_name=$(basename "$dir")
183+
# Create a zip archive with the same name as the folder
184+
7z a -tzip "${folder_name}.zip" "$folder_name"
185+
done
178186
- name: Release
179187
uses: softprops/action-gh-release@v2
180188
with:
181189
name: ${{ env.releaseName }}
182190
tag_name: ${{ env.tagName }}
183191
files: |
184-
./artifacts/${{ needs.build.outputs.linuxx64_matlab_artifact }}/MEXlibCZI.mexa64
185-
./artifacts/${{ needs.build.outputs.windowsx64_matlab_artifact }}/MEXlibCZI.mexw64
186-
./artifacts/${{ needs.build.outputs.linuxx64_octave_artifact }}/octavelibczi.mex
187-
./artifacts/${{ needs.build.outputs.linuxx64_octave_artifact }}/libmexlibczi.so
188-
./artifacts/${{ needs.build.outputs.windowsx64_octave_artifact }}/octavelibczi.mex
189-
./artifacts/${{ needs.build.outputs.windowsx64_octave_artifact }}/libmexlibczi.dll
192+
./artifacts/*.zip
190193
prerelease: true
191194

0 commit comments

Comments
 (0)