Skip to content

Commit

Permalink
test 7
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengyangliu committed Jul 12, 2024
1 parent 7db7e4b commit 5f10c59
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/sync_release_to_gitee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ jobs:
core.setOutput('tag_name', response.data.tag_name);
core.setOutput('name', response.data.name);
core.setOutput('body', response.data.body);
return response.data;
- name: Download release assets
run: |
assets=$(echo '${{ steps.get_release_info.outputs.assets }}' | jq -r '.[] | .browser_download_url')
for url in $assets; do
wget -q $url -P ./downloads
wget -q $url -P ./downloads
done
- name: Create Gitee Release
id: create_gitee_release
uses: actions/github-script@v6
with:
script: |
Expand All @@ -46,7 +48,7 @@ jobs:
'Authorization': `Bearer ${process.env.GITEE_TOKEN}`
},
body: JSON.stringify({
access_token: `${{ secrets.GITEE_TOKEN }}`,
access_token: process.env.GITEE_TOKEN,
tag_name: `${{ steps.get_release_info.outputs.tag_name }}`,
name: `${{ steps.get_release_info.outputs.name }}`,
body: `${{ steps.get_release_info.outputs.body }}`,
Expand All @@ -59,5 +61,20 @@ jobs:
core.setFailed(`Error creating Gitee release: ${error.message}`);
} else {
const data = await response.json();
core.setOutput('gitee_release_id', data.id); // Set output with Gitee release ID
console.log('Gitee release created successfully:', data);
}
env:
GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}

- name: Upload assets to Gitee Release
run: |
releaseId="${{ steps.get_release_info.outputs.release_id }}"
for file in ./downloads/*; do
curl -X POST \
-F "access_token=${{ secrets.GITEE_TOKEN }}" \
-F "file=@${file}" \
"https://gitee.com/api/v5/reposopenblockcc/external-resources-v3/releases/${releaseId}/attach_files"
done
env:
GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}

0 comments on commit 5f10c59

Please sign in to comment.