Skip to content

Commit 24606a3

Browse files
authored
fix: Fix typo in variable name, make pipeline more strict for zip (#1397)
* fix: Fix a typo in platform variable for Windows script * fix: Fail if no zip found * fix: Format
1 parent f6d4891 commit 24606a3

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.github/workflows/library-release.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
shell: pwsh
5656
run: |
5757
./make_release.ps1
58-
58+
5959
- name: Build release
6060
if: matrix.os != 'windows-latest'
6161
run: make release TARGET=${{ matrix.target }}
@@ -84,10 +84,15 @@ jobs:
8484
- name: Extract tag_name from zip file
8585
id: extract_tag
8686
run: |
87-
ZIP=$(ls c2pa-v*-*.zip | head -n1)
88-
TAG_NAME=$(echo "$ZIP" | sed -E 's/^(c2pa-v[0-9]+\.[0-9]+\.[0-9]+)-.*\.zip/\1/')
89-
echo "Found tag: $TAG_NAME"
90-
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
87+
ZIP=$(find . -name "c2pa-v*-*.zip" | head -n1)
88+
if [ -n "$ZIP" ]; then
89+
TAG_NAME=$(echo "$ZIP" | sed -E 's/.*\/(c2pa-v[0-9]+\.[0-9]+\.[0-9]+)-.*\.zip/\1/')
90+
echo "Found tag: $TAG_NAME"
91+
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
92+
else
93+
echo "No zip files found"
94+
exit 1
95+
fi
9196
9297
- name: Create Release
9398
id: create_release

make_release.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ New-Item -ItemType Directory -Force -Path $libDir | Out-Null
111111
Copy-Item "$ReleaseDir\c2pa.h" $includeDir -Force
112112
Copy-Item "$ReleaseDir\c2pa_c.*" $libDir -Force
113113

114-
$zipPath = "$artifactsDir\c2pa-v$version-$Platform.zip"
115-
Compress-Archive -Path "$includeDir", "$libDir" -DestinationPath $zipPath -Force
114+
$zipPath = "$artifactsDir\c2pa-v$version-$platform.zip"
115+
Compress-Archive -Path "$includeDir", "$libDir" -DestinationPath $zipPath -Force
116116

117117
Write-Host "Zip file created: $zipPath"
118118
Write-Host "Setup completed successfully!"

0 commit comments

Comments
 (0)