1+ name : torrenttools
2+ on :
3+ workflow_dispatch :
4+ inputs :
5+ name :
6+ description : Name of the torrent file
7+ required : true
8+ default : Firefox Setup 122.0.1
9+ comment :
10+ description : Comment
11+ required : true
12+ default : Firefox Setup 122.0.1 win64 en-US by torrent-webseed-creator
13+ url :
14+ description : URL of the file
15+ required : true
16+ default : https://download-installer.cdn.mozilla.net/pub/firefox/releases/122.0.1/win64/en-US/Firefox%20Setup%20122.0.1.exe
17+ file_name :
18+ description : File name of the file in the torrent
19+ required : true
20+ default : Firefox Setup 122.0.1.exe
21+ piece_size :
22+ description : Piece Size. Use auto for automatic calculation, or use the recommended piece size on the README.md file
23+ required : true
24+ default : auto
25+ protocol_version :
26+ description : BitTorrent Protocol version 1, 2, or hybrid
27+ required : true
28+ default : 1
29+ type : choice
30+ options : [1, 2, hybrid]
31+ maximize_disk_space :
32+ description : Maximize disk space. Check if getting out of disk space error
33+ type : boolean
34+
35+ jobs :
36+ create_torrent :
37+ runs-on : ubuntu-latest
38+ steps :
39+ - name : Maximize disk space
40+ if : inputs.maximize_disk_space
41+ uses : easimon/maximize-build-space@v10
42+ with :
43+ remove-dotnet : true
44+ remove-android : true
45+ remove-haskell : true
46+ remove-codeql : true
47+ remove-docker-images : true
48+
49+ - name : Setup torrenttools
50+ uses : AnimMouse/setup-appimage@v1
51+ with :
52+ name : torrenttools
53+ url : https://github.com/fbdtemme/torrenttools/releases/download/v0.6.2/torrenttools-0.6.2-linux-x86_64.AppImage
54+
55+ - name : Download file
56+ run : aria2c -x 16 -o "${{ inputs.file_name }}" "${{ inputs.url }}"
57+
58+ - name : Create torrent using torrenttools
59+ run : torrenttools create -v "${{ inputs.protocol_version }}" -o "${{ inputs.name }}.torrent" -w "${{ inputs.url }}" -c "${{ inputs.comment }}" -l "${{ inputs.piece_size }}" -s "torrent-webseed-creator" "${{ inputs.file_name }}"
60+
61+ - name : Upload torrent file
62+ uses : actions/upload-artifact@v4
63+ with :
64+ name : ${{ inputs.name }}
65+ path : ${{ inputs.name }}.torrent
66+ compression-level : 0
0 commit comments