torrenttools #7
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
name: torrenttools | |
on: | |
workflow_dispatch: | |
inputs: | |
name: | |
description: Name of the torrent file | |
required: true | |
default: Firefox Setup 122.0.1 | |
comment: | |
description: Comment | |
required: true | |
default: Firefox Setup 122.0.1 win64 en-US by torrent-webseed-creator | |
url: | |
description: URL of the file | |
required: true | |
default: https://download-installer.cdn.mozilla.net/pub/firefox/releases/122.0.1/win64/en-US/Firefox%20Setup%20122.0.1.exe | |
file_name: | |
description: File name of the file in the torrent | |
required: true | |
default: Firefox Setup 122.0.1.exe | |
piece_size: | |
description: Piece Size. Use auto for automatic calculation, or use the recommended piece size on the README.md file | |
required: true | |
default: auto | |
protocol_version: | |
description: BitTorrent Protocol version 1, 2, or hybrid | |
required: true | |
default: 1 | |
type: choice | |
options: [1, 2, hybrid] | |
maximize_disk_space: | |
description: Maximize disk space. Check if getting out of disk space error | |
type: boolean | |
jobs: | |
create_torrent: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Maximize disk space | |
if: inputs.maximize_disk_space | |
uses: easimon/maximize-build-space@v10 | |
with: | |
remove-dotnet: true | |
remove-android: true | |
remove-haskell: true | |
remove-codeql: true | |
remove-docker-images: true | |
- name: Setup torrenttools | |
uses: AnimMouse/setup-appimage@v1 | |
with: | |
name: torrenttools | |
url: https://github.com/fbdtemme/torrenttools/releases/download/v0.6.2/torrenttools-0.6.2-linux-x86_64.AppImage | |
- name: Download file | |
run: aria2c -x 16 -o "${{ inputs.file_name }}" "${{ inputs.url }}" | |
- name: Create torrent using torrenttools | |
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 }}" | |
- name: Upload torrent file | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ inputs.name }} | |
path: ${{ inputs.name }}.torrent | |
compression-level: 0 |