From b4e550b89065bf11d5442e50ef3338b79c0e0858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Mas=C5=82owski?= Date: Mon, 13 Jan 2025 19:49:06 +0100 Subject: [PATCH 1/4] feat(ci): Generate and upload BitTorrent metadata for built ISOs --- .github/workflows/build_iso.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_iso.yml b/.github/workflows/build_iso.yml index e1d6f3818b..d9d13783ba 100644 --- a/.github/workflows/build_iso.yml +++ b/.github/workflows/build_iso.yml @@ -147,7 +147,21 @@ jobs: additional_templates: '/github/workspace/installer/lorax_templates/remove_root_password_prompt.tmpl /github/workspace/installer/lorax_templates/set_default_user.tmpl' repos: '/github/workspace/bazzite.repo /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora-updates.repo' - - name: Move ISOs to Upload Directory + - name: Generate a .torrent file + id: create-torrent + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y mktorrent + TORRENT_DIR=${{ github.workspace }}/torrent + mkdir ${TORRENT_DIR} + cd ${TORRENT_DIR} && mktorrent \ + --piece-length=20 \ + --web-seed="https://download.bazzite.gg/${{ steps.build.outputs.iso_name }}" \ + ${{ steps.build.outputs.iso_path }}/${{ steps.build.outputs.iso_name }} + echo "torrent-dir=${TORRENT_DIR}" >> $GITHUB_OUTPUT + + - name: Move ISO, checksum and torrent to Upload Directory id: upload-directory shell: bash run: | @@ -155,9 +169,10 @@ jobs: mkdir ${ISO_UPLOAD_DIR} mv ${{ steps.build.outputs.iso_path }}/${{ steps.build.outputs.iso_name }} ${ISO_UPLOAD_DIR} mv ${{ steps.build.outputs.iso_path }}/${{ steps.build.outputs.iso_name }}-CHECKSUM ${ISO_UPLOAD_DIR} + mv ${{ steps.create-torrent.outputs.torrent-dir }}/${{ steps.build.outputs.iso_name }}.torrent ${ISO_UPLOAD_DIR} echo "iso-upload-dir=${ISO_UPLOAD_DIR}" >> $GITHUB_OUTPUT - - name: Upload ISOs and Checksum to Job Artifacts + - name: Upload ISO, checksum and torrent to Job Artifacts if: github.ref_name == 'testing' #if: github.event_name == 'pull_request' uses: actions/upload-artifact@v4 @@ -169,7 +184,7 @@ jobs: compression-level: 0 overwrite: true - - name: Upload ISOs and Checksum to R2 + - name: Upload ISO, checksum and torrent to R2 if: github.event_name == 'workflow_dispatch' && github.ref_name == 'main' shell: bash env: From 4701836d285d43936920d930a836e9c834edeefc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Mas=C5=82owski?= Date: Mon, 13 Jan 2025 20:00:18 +0100 Subject: [PATCH 2/4] WIP: Specify which ISO build the .torrent corresponds to (DO NOT MERGE YET!) --- .github/workflows/build_iso.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_iso.yml b/.github/workflows/build_iso.yml index d9d13783ba..48d40dbb86 100644 --- a/.github/workflows/build_iso.yml +++ b/.github/workflows/build_iso.yml @@ -156,6 +156,7 @@ jobs: TORRENT_DIR=${{ github.workspace }}/torrent mkdir ${TORRENT_DIR} cd ${TORRENT_DIR} && mktorrent \ + --comment="TODO: put at least a version number here" \ --piece-length=20 \ --web-seed="https://download.bazzite.gg/${{ steps.build.outputs.iso_name }}" \ ${{ steps.build.outputs.iso_path }}/${{ steps.build.outputs.iso_name }} From f903879dac6d7f8f20ff27711605340ec3cb1d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Mas=C5=82owski?= Date: Mon, 13 Jan 2025 20:01:22 +0100 Subject: [PATCH 3/4] draft: Use the Fedora tracker when generating torrents (DO NOT MERGE YET!) --- .github/workflows/build_iso.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_iso.yml b/.github/workflows/build_iso.yml index 48d40dbb86..1110f6d25d 100644 --- a/.github/workflows/build_iso.yml +++ b/.github/workflows/build_iso.yml @@ -156,6 +156,7 @@ jobs: TORRENT_DIR=${{ github.workspace }}/torrent mkdir ${TORRENT_DIR} cd ${TORRENT_DIR} && mktorrent \ + --announce="http://torrent.fedoraproject.org:6969" \ --comment="TODO: put at least a version number here" \ --piece-length=20 \ --web-seed="https://download.bazzite.gg/${{ steps.build.outputs.iso_name }}" \ From 390e5d6fcdd3d07b53cfa20971e7e3d7786c07a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Mas=C5=82owski?= Date: Tue, 14 Jan 2025 14:44:08 +0100 Subject: [PATCH 4/4] Update .github/workflows/build_iso.yml Co-authored-by: AzemaViator <103060968+AzemaViator@users.noreply.github.com> --- .github/workflows/build_iso.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_iso.yml b/.github/workflows/build_iso.yml index 1110f6d25d..dadc22af7b 100644 --- a/.github/workflows/build_iso.yml +++ b/.github/workflows/build_iso.yml @@ -156,7 +156,8 @@ jobs: TORRENT_DIR=${{ github.workspace }}/torrent mkdir ${TORRENT_DIR} cd ${TORRENT_DIR} && mktorrent \ - --announce="http://torrent.fedoraproject.org:6969" \ + --announce="udp://fosstorrents.com:6969/announce" \ + --announce="http://fosstorrents.com:6969/announce" \ --comment="TODO: put at least a version number here" \ --piece-length=20 \ --web-seed="https://download.bazzite.gg/${{ steps.build.outputs.iso_name }}" \