torf-cli #3
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: torf-cli | |
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 | |
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: Install torf-cli | |
run: pipx install torf-cli | |
- name: Download file | |
run: aria2c -x 16 -o "${{ inputs.file_name }}" "${{ inputs.url }}" | |
- name: Create torrent using torf-cli | |
run: torf "${{ inputs.file_name }}" -o "${{ inputs.name }}.torrent" -w "${{ inputs.url }}" -c "${{ inputs.comment }}" -s "torrent-webseed-creator" | |
- name: Upload torrent file | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ inputs.name }} | |
path: ${{ inputs.name }}.torrent | |
compression-level: 0 |