-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from Do-sth-sharp/master
[CI]: Add binary files auto glob on Linux and Mac OS platforms
- Loading branch information
Showing
3 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,26 +44,32 @@ jobs: | |
- name: Build the application | ||
run: dotnet publish --configuration Release -r ${{ matrix.runtime }} | ||
|
||
- name: Move artifacts - Windows | ||
if: runner.os == 'Windows' | ||
- name: Move artifacts | ||
shell: pwsh | ||
run: Move-Item -Path TuneLab\bin\Release\net8.0\${{ matrix.runtime }}\publish -Destination workspace | ||
|
||
- name: Move artifacts - MacOS and Linux | ||
if: runner.os != 'Windows' | ||
run: mv TuneLab/bin/Release/net8.0/${{ matrix.runtime }}/publish workspace | ||
|
||
- name: Generate artifact attestation - Windows | ||
if: runner.os == 'Windows' && github.event_name != 'pull_request' | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-path: '"workspace/*.dll","workspace/*.exe"' | ||
|
||
- name: Find executable and dynamic library files - MacOS and Linux | ||
if: runner.os != 'Windows' && github.event_name != 'pull_request' | ||
id: find-executable-files | ||
shell: bash | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
find ./CIUtils/ -name "*.sh" -exec chmod +x {} \; | ||
EXEC_FILES=$(./CIUtils/find-executable.sh "workspace/") | ||
echo "Found executable and dynamic library files: $EXEC_FILES" | ||
echo "exec_files=$EXEC_FILES" >> $GITHUB_OUTPUT | ||
- name: Generate artifact attestation - MacOS and Linux | ||
if: runner.os != 'Windows' && github.event_name != 'pull_request' | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-path: '"workspace/*.dll","workspace/ExtensionInstaller","workspace/TuneLab"' | ||
subject-path: '"workspace/*.dll",${{ steps.find-executable-files.outputs.exec_files }}' | ||
|
||
- name: Get short SHA | ||
uses: benjlevesque/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Check if a directory is provided as an argument | ||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <directory>" | ||
exit 1 | ||
fi | ||
|
||
# Directory to search | ||
directory=$1 | ||
|
||
# Find ELF, Mach-O and Universal Binary files in the specified directory | ||
files=$(find "$directory" -type f -exec sh -c 'file -b "$1" | grep -qE "ELF|Mach-O|universal binary" && echo "$1" | sed "s:/\{1,\}:/:g"' _ {} \;) | ||
|
||
# Initialize an empty string for the output | ||
output="" | ||
|
||
# Loop through each file and format it | ||
for file in $files; do | ||
if [ -z "$output" ]; then | ||
output="\"$file\"" | ||
else | ||
output="$output,\"$file\"" | ||
fi | ||
done | ||
|
||
# Print the formatted output | ||
echo $output |