Skip to content

Commit 30927f4

Browse files
committed
Add packages to release
1 parent 96d5c5a commit 30927f4

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
jobs:
7+
build-and-upload:
8+
runs-on: linux-aarch64-a3-2
9+
container:
10+
image: swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:8.3.rc1-a3-ubuntu22.04-py3.11
11+
steps:
12+
- name: Clean git config
13+
run: |
14+
CONFIG_KEY='http.https://gh-proxy.test.osinfra.cn/.extraheader'
15+
git config --global --unset "$CONFIG_KEY" || true
16+
17+
- name: Clean workspace
18+
run: |
19+
sudo rm -rf --one-file-system "$GITHUB_WORKSPACE"/* "$GITHUB_WORKSPACE"/.* 2>/dev/null || true
20+
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
with:
24+
clean: true
25+
26+
- name: Build wheel packages
27+
run: bash build.sh
28+
29+
- name: Upload wheel to release
30+
run: |
31+
cd ./output
32+
for whl in *.whl; do
33+
if [[ -f "$whl" ]]; then
34+
echo "Uploading $whl..."
35+
asset_name="$whl"
36+
curl -sL \
37+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
38+
-H "Content-Type: application/octet-stream" \
39+
--data-binary @"$whl" \
40+
"${{ github.event.release.upload_url }}"?name=$asset_name
41+
fi
42+
done
43+
shell: bash

0 commit comments

Comments
 (0)