Skip to content

Commit

Permalink
CI:修正上传错误
Browse files Browse the repository at this point in the history
  • Loading branch information
alx696 committed Aug 16, 2021
1 parent 10724d0 commit 013bd49
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,44 @@ jobs:
- name: Build
run: |
sh build.sh
ls -l build/*
- name: Upload
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
run: |
sudo apt-get install -y jq
GIT_TAG=`echo $GITHUB_REF | sed 's/refs\/tags\///'`
upload_url=`curl \
# get upload url
API_UPLOAD_URL=`curl \
-X POST \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${GITHUB_REPOSITORY}/releases \
-d '{"tag_name":"'${GIT_TAG}'"}' \
| jq --raw-output '.upload_url' \
| sed 's/{?name,label}/?name/'`
# upload
curl \
-X POST \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
-F 'file=@build/polong-core-linux' \
${upload_url}=polong-core-linux
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Content-Type: application/octet-stream" \
--data-binary @'build/polong-core-linux' \
${API_UPLOAD_URL}=polong-core-linux
# upload
curl \
-X POST \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
-F 'file=@build/polong-core-windows' \
${upload_url}=polong-core-windows
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Content-Type: application/octet-stream" \
--data-binary @'build/polong-core-windows' \
${API_UPLOAD_URL}=polong-core-windows
# upload
curl \
-X POST \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
-F 'file=@build/polong-core.aar' \
${upload_url}=polong-core.aar
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Content-Type: application/octet-stream" \
--data-binary @'build/polong-core.aar' \
${API_UPLOAD_URL}=polong-core.aar

0 comments on commit 013bd49

Please sign in to comment.