Skip to content

Commit

Permalink
add file
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottLL committed Nov 14, 2023
1 parent 24053f8 commit 59fa730
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ jobs:
echo "Modification with sed failed."
exit 1
fi
- name: Prepare cloud-init
run: |
sed -i "s/\$GITHUB_TOKEN/${{ secrets.PAT }}/" workflow-artifacts/cloud-init.txt
- name: Login via Az module
uses: azure/login@v1
Expand Down
16 changes: 15 additions & 1 deletion workflow-artifacts/cloud-init.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,19 @@ export PATH="$HOME/.cargo/bin:$PATH"
git clone https://github.com/huggingface/candle.git /root/candle
cd /root/candle

cargo build --example whisper --release
if cargo build --example whisper --release; then
FILE="/root/candle/target/release/examples/whisper"
MIME_TYPE=$(file -b --mime-type "$FILE")
TAG="v$(date +%Y%m%d%H%M%S)"
RELEASE_NAME="CPU Whisper Binary Release"
GITHUB_TOKEN="$GITHUB_TOKEN" # Token passed from GitHub Actions

CREATE_RELEASE_RESPONSE=$(curl -X POST -H "Authorization: token $GITHUB_TOKEN" -H "Content-Type: application/json" -d "{\"tag_name\": \"$TAG\", \"name\": \"$RELEASE_NAME\"}" "https://api.github.com/repos/nogibjj/candle_scott_Azure_vm/releases")
UPLOAD_URL=$(echo $CREATE_RELEASE_RESPONSE | jq -r .upload_url | sed "s/{?name,label}//")

curl -X POST -H "Authorization: token $GITHUB_TOKEN" -H "Content-Type: $MIME_TYPE" --data-binary @"$FILE" "$UPLOAD_URL?name=$(basename "$FILE")"
else
echo "Cargo build failed."
fi


0 comments on commit 59fa730

Please sign in to comment.