-
-
Notifications
You must be signed in to change notification settings - Fork 9
45 lines (35 loc) · 1.33 KB
/
release-libs.yml
File metadata and controls
45 lines (35 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Generate Release Assets (DuckDB C libs)
on:
release:
types: [published]
jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Define target folders 📁
id: folders
run: |
echo "folders=linux-amd64 linux-arm64 osx-universal windows-amd64 windows-arm64" >> $GITHUB_OUTPUT
- name: Compress and Upload Assets 🚀
run: |
RELEASE_ID=${{ github.event.release.id }}
for FOLDER in ${{ steps.folders.outputs.folders }}; do
ASSET_NAME="${FOLDER}.zip"
FILE_PATH="./lib/${FOLDER}"
ZIP_PATH="./${ASSET_NAME}"
echo "Processing folder: ${FOLDER}"
zip -r -j -9 "${ZIP_PATH}" "${FILE_PATH}"
if [ -f "${ZIP_PATH}" ]; then
echo "Successfully created ${ASSET_NAME}"
echo "Uploading ${ASSET_NAME}..."
gh asset upload "${ZIP_PATH}" --repo "${{ github.repository }}" --release-id "${RELEASE_ID}" --clobber
echo "Upload of ${ASSET_NAME} complete."
else
echo "Error: Failed to create ${ASSET_NAME}"
exit 1
fi
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}