Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
actions: Upload file to Github Release
Browse files Browse the repository at this point in the history
  • Loading branch information
toraidl committed Apr 8, 2024
1 parent 19b4df4 commit cfdbe63
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/build_mi10_series_hyperos_push_to_onedrive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,27 @@ jobs:
sudo bash "$GITHUB_WORKSPACE"/port.sh ${{ github.event.inputs.STOCK_URL }} ${{ github.event.inputs.PORT_URL }}
- name: 6. 准备上传 | PREPARE UPLOADING
run: |
ROM_NAME=$(basename $(find "$GITHUB_WORKSPACE"/out -name "*.zip"))
OS_VERSION=$(echo $ROM_NAME | cut -d "_" -f3)
ROM_FILE=$(basename $(find "$GITHUB_WORKSPACE"/out -name "*.zip"))
echo "ROM_FILE=$ROM_FILE" >>$GITHUB_ENV
OS_VERSION=$(echo $ROM_FILE | cut -d "_" -f3)
echo "OS_VERSION=$OS_VERSION" >>$GITHUB_ENV
mkdir -p "$GITHUB_WORKSPACE"/GithubRelease
cd "$GITHUB_WORKSPACE"/GithubRelease
sudo split -b 1536M -d "$GITHUB_WORKSPACE"/out/$ROM_NAME" "$ROM_NAME"
sudo split -b 1536M -d "$GITHUB_WORKSPACE"/out/$ROM_FILE $ROM_FILE
ls -al "$GITHUB_WORKSPACE"/GithubRelease/
- name: 7.上传到OneDrive | PUSH ROM TO ONEDRIVE
run: |
rclone sync -P "$GITHUB_WORKSPACE"/out/"$ROM_NAME" onedrive:/ROM/github-actions
SHARE_LINK=$(rclone link onedrive:/ROM/github-actions/"$ROM_NAME" --onedrive-link-scope anonymous)
rclone sync -P "$GITHUB_WORKSPACE"/out/${{ env.ROM_FILE }} onedrive:/ROM/github-actions
SHARE_LINK=$(rclone link onedrive:/ROM/github-actions/${{ env.ROM_FILE }} --onedrive-link-scope anonymous)
touch file.log
echo "Onedrive下载链接 | Onedrive download link for $ROM_NAME: \n$SHARE_LINK" > file.log
echo "Onedrive下载链接 | Onedrive download link for ${{ env.ROM_FILE }}: \n$SHARE_LINK" > file.log
- name: 8. 上传到Github Release| UPLOAD ROM TO GITHUB RELEASAE
uses: ncipollo/release-action@main
with:
artifacts: ${{ github.workspace }}/GithubRelease/*
name: $ROM_NAME
tag: $OS_VERSION
name: ${{ env.ROM_FILE }}
tag: ${{ env.OS_VERSION }}
bodyFile: "${{ github.workspace }}/file.log"
allowUpdates: true
artifactErrorsFailBuild: true

0 comments on commit cfdbe63

Please sign in to comment.