Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial support for BitTorrent distribution of ISOs #2126

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions .github/workflows/build_iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,34 @@ 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 \
--announce="http://torrent.fedoraproject.org:6969" \
mskiptr marked this conversation as resolved.
Show resolved Hide resolved
--comment="TODO: put at least a version number here" \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skopeo inspect docker://${{ steps.registry_case.outputs.lowercase }}/${{ matrix.image_name }}:${{ steps.generate-tag.outputs.tag }} | jq -r '.Labels["org.opencontainers.image.version"]'

This can be used to get the release version. ie

$ skopeo inspect docker://ghcr.io/ublue-os/bazzite:stable | jq -r '.Labels["org.opencontainers.image.version"]'
41.20250106.3

I am not sure if skopeo or jq are available in this job, but you should be able to use it to get something in the comments like Installer for bazzite-deck-nivida version 41.20250106.3

--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: |
ISO_UPLOAD_DIR=${{ github.workspace }}/upload
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
Expand All @@ -169,7 +186,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:
Expand Down