Skip to content

Commit d2f9a27

Browse files
committed
add automatic release asset upload on GitHub release
1 parent 3388187 commit d2f9a27

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
tags: ["*"]
77
pull_request:
88
branches: [master]
9+
release:
10+
types: [published]
911

1012
jobs:
1113
build-mac:
@@ -81,3 +83,26 @@ jobs:
8183
with:
8284
name: libskia-windows-${{ matrix.arch }}
8385
path: dist/*.zip
86+
87+
deploy:
88+
if: github.event_name == 'release'
89+
needs: [build-mac, build-linux, build-windows]
90+
runs-on: ubuntu-latest
91+
permissions:
92+
contents: write
93+
steps:
94+
- uses: actions/download-artifact@v4
95+
with:
96+
path: artifacts
97+
- name: Upload release assets
98+
env:
99+
GH_TOKEN: ${{ github.token }}
100+
run: |
101+
for artifact_dir in artifacts/*/; do
102+
for file in "$artifact_dir"*.zip; do
103+
if [ -f "$file" ]; then
104+
echo "Uploading $file..."
105+
gh release upload ${{ github.event.release.tag_name }} "$file" --repo ${{ github.repository }}
106+
fi
107+
done
108+
done

0 commit comments

Comments
 (0)