CI #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the workflow will run | |
on: | |
issues: | |
types: [opened ] | |
issue_comment: | |
types: [created ] | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
download: | |
runs-on: ubuntu-latest | |
steps: | |
- name: clone repository | |
uses: actions/checkout@v2 | |
- name: download | |
run: | | |
export actor=${{ github.actor }} | |
export repo=${{ github.repository }} | |
#git config --global --add safe.directory $PWD | |
# git | |
git config --global http.postBuffer 524288000 | |
git config --global http.maxRequestBuffer 200M | |
git config --global http.core.compression 0 | |
git config --global user.name 'download-action[bot]' | |
git config --global user.email '[email protected]' | |
git remote set-url origin https://${actor}:${GITHUB_TOKEN}@github.com/${repo}.git | |
git pull --rebase | |
for i in *.torrent | |
do | |
aria2c "$i" --on-download-complete=exit | |
done | |
for item in `ls` | |
do | |
size=`ls -l ${item} | awk '{print $5}'` | |
if [ $size -gt 104857600 ]; then | |
zip -r ${item}.zip ${item} | |
zip -s 100m ${item}.zip --out output-${item}.zip | |
rm ${item}* | |
fi | |
done | |
git add . | |
git commit -m "upload" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} |